need support for configuring syslog

Bug #1478103 reported by Scott Moser on 2015-07-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
High
Unassigned
cloud-init
Medium
Scott Moser

Bug Description

in order to instruct a host to easily log syslog information to another system, we need to add a cloud-config format for this.

The format to use looks like this:
## syslog module allows you to configure the systems syslog.
## configuration of syslog is under the top level cloud-config
## entry 'syslog'.
##
## "remotes"
## remotes is a dictionary. items are of 'name: remote_info'
## name is simply a name (example 'maas'). It has no importance other than
## for cloud-init merging configs
##
## remote_info is of the format
## * optional filter for log messages
## default if not present: *.*
## * optional leading '@' or '@@' (indicates udp or tcp).
## default if not present (udp): @
## This is rsyslog format for that. if not present, is '@' which is udp
## * ipv4 or ipv6 or hostname
## ipv6 addresses must be encoded in [::1] format. example: @[fd00::1]:514
## * optional port
## port defaults to 514
##
## Example:
#cloud-config
rsyslog:
 remotes:
  # udp to host 'maas.mydomain' port 514
  maashost: maas.mydomain
  # udp to ipv4 host on port 514
  maas: "@[10.5.1.56]:514"
  # tcp to host ipv6 host on port 555
  maasipv6: "*.* @@[FE80::0202:B3FF:FE1E:8329]:555"

Related branches

Scott Moser (smoser) on 2015-07-24
description: updated
Changed in maas:
milestone: none → 1.9.0
importance: Undecided → Wishlist
status: New → Confirmed
no longer affects: maas
Scott Moser (smoser) wrote :

added a branch at lp:~smoser/cloud-init/syslog-rework
that implements much of the above.

then realized cc_rsyslog.conf is present in cloud-init since before 2012.
its config looks like:

#cloud-config
rsyslog:
  - "*.* @@192.158.1.1"
  - content: "*.* @@192.0.2.1:10514"
  - filename: 01-examplecom.conf
    content: |
      *.* @@syslogd.example.com

I'll spend some time monday getting the improved test and systemd restart that i have in my new branch into the older one. Also will support calling the dictionary as 'syslog' rather than rsyslog to be more generic.

Scott Moser (smoser) wrote :
Changed in cloud-init:
assignee: nobody → Scott Moser (smoser)
status: New → Fix Committed
importance: Undecided → Medium
Scott Moser (smoser) on 2015-07-28
Changed in maas:
status: New → Confirmed
importance: Undecided → Medium
Scott Moser (smoser) wrote :

I marked this as affecting maas.
to make cloud-init configure syslog to the maas system , maas will have to adjust the cloud-config that it sends to instances.

a.) supported back to precise
#cloud-config
rsyslog:
 - "*.* @<MAAS_SERVER_IP>"

b.) supported trunk (wily) and going forward. This format can be ported back to trusty if requested.
#cloud-config
rsyslog:
 remotes:
  maas: <MAAS_SERVER_IP>

The benefit of using 'b' is that it "merges" better, for the future world when maas provides vendor-data.
To illustrate that point, consider:
  i.) maas provides remote syslog config via vendor-data
      #cloud-config
      rsyslog:
        remotes: {'maas': "<MAAS_SERVER>"}
  ii.) juju provides remote syslog config via user-data
      #cloud-config
      rsyslog:
         remotes: {'juju': "JUJU_SERVER"}

cloud-init merges those 2 configs so that the result has both 'juju' and 'maas' config.
if the user (or juju) wanted to disable maas, then they can by providing user-data like;
  #cloud-config
  rsyslog:
    remotes: {'maas': "", 'myserver': "MYSERVER"}

description: updated
Changed in maas:
milestone: none → 1.9.0
Gavin Panella (allenap) on 2015-09-02
Changed in maas:
status: Confirmed → Triaged
Changed in maas:
milestone: 1.9.0 → 2.0.0
importance: Medium → High
Changed in maas:
status: Triaged → Fix Committed
Scott Moser (smoser) wrote :

This is fixed in cloud-init 0.7.7

Changed in cloud-init:
status: Fix Committed → Fix Released
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers