Add host_prep_task to setup proper logging for Swift

Recent overcloud images seem to be more lightweight, and the
openstack-swift-*.rpms are no longer installed. However, these rpms
created an entry in /etc/rsyslog.d/openstack-swift.conf, which ensures
that Swift logs are actually written to /var/log/swift/swift.log

This file is now missing, and thus logs mess up /var/log/messages.

Closes-Bug: 1776180
Change-Id: Icf4310558e3cceafbdd67f72432e59730b96a588
This commit is contained in:
Christian Schwede 2018-06-11 11:14:26 +02:00
parent 39939708b7
commit 916845f55d
2 changed files with 24 additions and 0 deletions

View File

@ -253,6 +253,18 @@ outputs:
src: /var/log/swift
dest: /var/log/containers/swift
state: link
- name: Forward logging to swift.log file
copy:
content: |
# Fix for https://bugs.launchpad.net/tripleo/+bug/1776180
local2.* /var/log/swift/swift.log
& stop
dest: /etc/rsyslog.d/openstack-swift.conf
register: logconfig
- name: Restart rsyslogd service after logging conf change
service: name=rsyslog state=restarted
when:
- logconfig|changed
upgrade_tasks:
- name: Check if swift-proxy or swift-object-expirer are deployed
command: systemctl is-enabled --quiet "{{ item }}"

View File

@ -459,6 +459,18 @@ outputs:
Log files from swift containers can be found under
/var/log/containers/swift and /var/log/containers/httpd/swift-*.
ignore_errors: true
- name: Forward logging to swift.log file
copy:
content: |
# Fix for https://bugs.launchpad.net/tripleo/+bug/1776180
local2.* /var/log/swift/swift.log
& stop
dest: /etc/rsyslog.d/openstack-swift.conf
register: logconfig_changed
- name: Restart rsyslogd service after logging conf change
service: name=rsyslog state=restarted
when:
- logconfig|changed
- name: Format SwiftRawDisks
filesystem:
fstype: xfs