Merge "Fix swift log redirection" into stable/wallaby

This commit is contained in:
Zuul 2021-10-01 05:25:56 +00:00 committed by Gerrit Code Review
commit b7f5549fd5
2 changed files with 36 additions and 44 deletions

View File

@ -444,35 +444,31 @@ outputs:
- { 'path': /var/log/swift, 'setype': container_file_t }
- { 'path': /var/log/containers/swift, 'setype': container_file_t, 'mode': '0750' }
deploy_steps_tasks:
- name: Configure rsyslog for swift-proxy
- name: Configure rsyslog for swift
when:
- step|int == 1
- swift_logconfig is not defined
- swift_rsyslog_config is not defined
block:
- name: Check if rsyslog exists
systemd:
name: rsyslog
shell: systemctl is-active rsyslog
register: swift_rsyslog_config
- block:
- name: Forward logging to swift.log file
copy:
content: |
# Fix for https://bugs.launchpad.net/tripleo/+bug/1776180
local2.* /var/log/containers/swift/swift.log
& stop
dest: /etc/rsyslog.d/openstack-swift.conf
register: swift_logconfig
- name: Restart rsyslogd service after logging conf change
service:
name: rsyslog
state: restarted
when:
- swift_logconfig is changed
- name: Forward logging to swift.log file
copy:
content: |
# Fix for https://bugs.launchpad.net/tripleo/+bug/1776180
local2.* /var/log/containers/swift/swift.log
& stop
dest: /etc/rsyslog.d/openstack-swift.conf
register: swift_logconfig
when:
- swift_rsyslog_config is defined
- swift_rsyslog_config.status is defined
- swift_rsyslog_config.status.ActiveState == 'active'
- swift_rsyslog_config.rc == 0
- name: Restart rsyslogd service after logging conf change
service:
name: rsyslog
state: restarted
when:
- swift_logconfig is defined
- swift_logconfig is changed
- name: Run kolla_set_configs to copy ring files
when: step|int == 5
shell: "{{ container_cli }} exec -u root {{ item }} /usr/local/bin/kolla_set_configs "

View File

@ -673,35 +673,31 @@ outputs:
with_items: "{{ swift_raw_disks }}"
when: swift_raw_disks|length > 0
deploy_steps_tasks:
- name: Configure rsyslog for swift-storage
- name: Configure rsyslog for swift
when:
- step|int == 1
- swift_logconfig is not defined
- swift_rsyslog_config is not defined
block:
- name: Check if rsyslog exists
systemd:
name: rsyslog
shell: systemctl is-active rsyslog
register: swift_rsyslog_config
- block:
- name: Forward logging to swift.log file
copy:
content: |
# Fix for https://bugs.launchpad.net/tripleo/+bug/1776180
local2.* /var/log/containers/swift/swift.log
& stop
dest: /etc/rsyslog.d/openstack-swift.conf
register: swift_logconfig
- name: Restart rsyslogd service after logging conf change
service:
name: rsyslog
state: restarted
when:
- swift_logconfig is changed
- name: Forward logging to swift.log file
copy:
content: |
# Fix for https://bugs.launchpad.net/tripleo/+bug/1776180
local2.* /var/log/containers/swift/swift.log
& stop
dest: /etc/rsyslog.d/openstack-swift.conf
register: swift_logconfig
when:
- swift_rsyslog_config is defined
- swift_rsyslog_config.status is defined
- swift_rsyslog_config.status.ActiveState == 'active'
- swift_rsyslog_config.rc == 0
- name: Restart rsyslogd service after logging conf change
service:
name: rsyslog
state: restarted
when:
- swift_logconfig is defined
- swift_logconfig is changed
- name: Run kolla_set_configs to copy ring files
when: step|int == 5
shell: "{{ container_cli }} exec -u root {{ item }} /usr/local/bin/kolla_set_configs"