From d63fd59024b74a90a479da0595dc5076764ce110 Mon Sep 17 00:00:00 2001 From: Andrey Shestakov Date: Tue, 13 Dec 2016 16:41:32 +0200 Subject: [PATCH] Add support of remote logging This change adds option remote_syslog_server, which allows to configure address of server to which rsyslog will send logs. Change-Id: I028bf219e2c3fc7aef95f543fbc5c33028bfe2e9 --- playbooks/roles/bifrost-ironic-install/README.md | 6 ++++++ .../roles/bifrost-ironic-install/tasks/bootstrap.yml | 4 +++- playbooks/roles/bifrost-ironic-install/tasks/start.yml | 4 ++++ .../templates/10-rsyslog-remote.conf.j2 | 1 + .../notes/support-remote-logging-93e159eeef4cc68b.yaml | 8 ++++++++ 5 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 playbooks/roles/bifrost-ironic-install/templates/10-rsyslog-remote.conf.j2 create mode 100644 releasenotes/notes/support-remote-logging-93e159eeef4cc68b.yaml diff --git a/playbooks/roles/bifrost-ironic-install/README.md b/playbooks/roles/bifrost-ironic-install/README.md index 24deda22a..f868fe41d 100644 --- a/playbooks/roles/bifrost-ironic-install/README.md +++ b/playbooks/roles/bifrost-ironic-install/README.md @@ -149,6 +149,12 @@ enable_cors_credential_support: Boolean value, default false. This variable domain: String value, default to false. If set, domain setting is configured in dnsmasq. +remote_syslog_server: String value, default undefined. If set, rsyslog is + configured to send logs to this server. + +remote_syslog_port: String value, default is 514. If set, custom port is + configured for remote syslog server. + ### Hardware Inspection Support Bifrost also supports the installation of ironic-inspector in standalone diff --git a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml index e02f01ca9..be26b84d1 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml @@ -341,4 +341,6 @@ command: semodule -e ironic_policy when: (ansible_os_family == 'RedHat' or ansible_os_family == 'Suse') and ansible_selinux.status == 'enabled' and ansible_selinux.mode == "enforcing" - +- name: "Configure remote logging" + template: src=10-rsyslog-remote.conf.j2 dest=/etc/rsyslog.d/10-rsyslog-remote.conf + when: remote_syslog_server is defined and remote_syslog_server != "" diff --git a/playbooks/roles/bifrost-ironic-install/tasks/start.yml b/playbooks/roles/bifrost-ironic-install/tasks/start.yml index ebc80a21d..b868d4231 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/start.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/start.yml @@ -17,6 +17,10 @@ command: systemctl daemon-reload when: init_template == 'systemd_template.j2' +- name: "Ensure rsyslog is running with current config" + service: name=rsyslog state=restarted + when: remote_syslog_server is defined and remote_syslog_server != "" + - name: "Start database service" service: name={{ mysql_service_name }} state=started diff --git a/playbooks/roles/bifrost-ironic-install/templates/10-rsyslog-remote.conf.j2 b/playbooks/roles/bifrost-ironic-install/templates/10-rsyslog-remote.conf.j2 new file mode 100644 index 000000000..8147541a3 --- /dev/null +++ b/playbooks/roles/bifrost-ironic-install/templates/10-rsyslog-remote.conf.j2 @@ -0,0 +1 @@ +*.* @{{ remote_syslog_server }}:{{ remote_syslog_port|default('514') }} diff --git a/releasenotes/notes/support-remote-logging-93e159eeef4cc68b.yaml b/releasenotes/notes/support-remote-logging-93e159eeef4cc68b.yaml new file mode 100644 index 000000000..220f6fdd1 --- /dev/null +++ b/releasenotes/notes/support-remote-logging-93e159eeef4cc68b.yaml @@ -0,0 +1,8 @@ +--- +features: + - Add support of remote logging. This feature allows to send logs + from local syslog server and not collects logs from services on + baremetal nodes. To collect from the actual running nodes requires + configuration injected into each deployed host. + Syslog server address and port can be specified in options + ``remote_syslog_server`` and ``remote_syslog_port`` respectively.