Browse Source

Merge "Install and start Rsyslog on the Undercloud & Standalone"

changes/88/674588/12
Zuul 2 years ago
committed by Gerrit Code Review
parent
commit
afcde249ae
  1. 47
      deployment/haproxy/haproxy-container-puppet.yaml
  2. 61
      deployment/haproxy/haproxy-pacemaker-puppet.yaml
  3. 57
      deployment/logging/rsyslog-baremetal-ansible.yaml
  4. 42
      deployment/swift/swift-proxy-container-puppet.yaml
  5. 44
      deployment/swift/swift-storage-container-puppet.yaml
  6. 1
      environments/standalone/standalone-tripleo.yaml
  7. 3
      environments/undercloud.yaml
  8. 5
      releasenotes/notes/rsyslog-5dc93db5eb8fc953.yaml
  9. 1
      roles/Undercloud.yaml
  10. 1
      roles_data_undercloud.yaml
  11. 2
      sample-env-generator/standalone.yaml

47
deployment/haproxy/haproxy-container-puppet.yaml

@ -286,6 +286,31 @@ outputs:
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
deploy_steps_tasks:
- name: Configure rsyslog for HAproxy container
when: step|int == 1
block:
- name: Check if rsyslog exists
shell: systemctl is-active rsyslog
register: rsyslog_config
- when:
- rsyslog_config is changed
- rsyslog_config.rc == 0
block:
- name: Forward logging to haproxy.log file
blockinfile:
content: |
if $syslogfacility-text == '{{facility}}' and $programname == 'haproxy' then -/var/log/containers/haproxy/haproxy.log
& stop
create: yes
path: /etc/rsyslog.d/openstack-haproxy.conf
vars:
facility: {get_param: HAProxySyslogFacility}
register: logconfig
- name: restart rsyslog service after logging conf change
service:
name: rsyslog
state: restarted
when: logconfig is changed
- name: Run puppet on the host to apply IPtables rules
when: step|int == 1
shell: |
@ -341,28 +366,6 @@ outputs:
tripleo_delegate_to: "{{ groups['haproxy'] | default([]) }}"
host_prep_tasks:
- {get_attr: [HAProxyPublicTLS, role_data, host_prep_tasks]}
- name: Check if rsyslog exists
shell: systemctl is-active rsyslog
register: rsyslog_config
- when:
- rsyslog_config is changed
- rsyslog_config.rc == 0
block:
- name: Forward logging to haproxy.log file
blockinfile:
content: |
if $syslogfacility-text == '{{facility}}' and $programname == 'haproxy' then -/var/log/containers/haproxy/haproxy.log
& stop
create: yes
path: /etc/rsyslog.d/openstack-haproxy.conf
vars:
facility: {get_param: HAProxySyslogFacility}
register: logconfig
- name: restart rsyslog service after logging conf change
service:
name: rsyslog
state: restarted
when: logconfig is changed
- name: create persistent directories
file:
path: "{{ item.path }}"

61
deployment/haproxy/haproxy-pacemaker-puppet.yaml

@ -287,28 +287,13 @@ outputs:
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
host_prep_tasks:
- {get_attr: [HAProxyBase, role_data, host_prep_tasks]}
- name: Check if rsyslog exists
shell: systemctl is-active rsyslog
register: rsyslog_config
- when:
- rsyslog_config is changed
- rsyslog_config.rc == 0
block:
- name: Forward logging to haproxy.log file
blockinfile:
content: |
if $syslogfacility-text == '{{facility}}' and $programname == 'haproxy' then -/var/log/containers/haproxy/haproxy.log
& stop
create: yes
path: /etc/rsyslog.d/openstack-haproxy.conf
vars:
facility: {get_param: HAProxySyslogFacility}
register: logconfig
- name: restart rsyslog service after logging conf change
service:
name: rsyslog
state: restarted
when: logconfig is changed
- name: haproxy logs readme
copy:
dest: /var/log/haproxy/readme.txt
content: |
Log files from the haproxy containers can be found under
/var/log/containers/haproxy.
ignore_errors: true
- name: create persistent directories
file:
path: "{{ item.path }}"
@ -318,16 +303,34 @@ outputs:
- { 'path': /var/log/containers/haproxy, 'setype': var_log_t }
- { 'path': /var/lib/haproxy, 'setype': svirt_sandbox_file_t }
- { 'path': /var/log/haproxy, 'setype': svirt_sandbox_file_t }
- name: haproxy logs readme
copy:
dest: /var/log/haproxy/readme.txt
content: |
Log files from the haproxy containers can be found under
/var/log/containers/haproxy.
ignore_errors: true
metadata_settings:
{get_attr: [HAProxyBase, role_data, metadata_settings]}
deploy_steps_tasks:
- name: Configure rsyslog for HAproxy container managed by Pacemaker
when: step|int == 1
block:
- name: Check if rsyslog exists
shell: systemctl is-active rsyslog
register: rsyslog_config
- when:
- rsyslog_config is changed
- rsyslog_config.rc == 0
block:
- name: Forward logging to haproxy.log file
blockinfile:
content: |
if $syslogfacility-text == '{{facility}}' and $programname == 'haproxy' then -/var/log/containers/haproxy/haproxy.log
& stop
create: yes
path: /etc/rsyslog.d/openstack-haproxy.conf
vars:
facility: {get_param: HAProxySyslogFacility}
register: logconfig
- name: restart rsyslog service after logging conf change
service:
name: rsyslog
state: restarted
when: logconfig is changed
- name: HAproxy tag container image for pacemaker
when: step|int == 1
import_role:

57
deployment/logging/rsyslog-baremetal-ansible.yaml

@ -0,0 +1,57 @@
heat_template_version: rocky
description: >
Install and start rsyslog.
parameters:
ServiceData:
default: {}
description: Dictionary packing service data
type: json
ServiceNetMap:
default: {}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry. This
mapping overrides those in ServiceNetMapDefaults.
type: json
DefaultPasswords:
default: {}
type: json
RoleName:
default: ''
description: Role name on which the service is applied
type: string
RoleParameters:
default: {}
description: Parameters specific to the role
type: json
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
outputs:
role_data:
description: Role data for the TripleO rsyslog service.
value:
service_name: rsyslog_baremetal_ansible
config_settings: {}
deploy_steps_tasks: []
docker_config: {}
kolla_config: {}
puppet_config:
config_volume: ''
step_config: ''
config_image: ''
host_prep_tasks:
- name: Ensure rsyslog is installed
package:
name: rsyslog
state: installed
- name: Ensure rsyslog is enabled and started
systemd:
state: started
name: rsyslog
enabled: true

42
deployment/swift/swift-proxy-container-puppet.yaml

@ -438,26 +438,30 @@ outputs:
- { 'path': /srv/node, 'setype': svirt_sandbox_file_t }
- { 'path': /var/log/swift, 'setype': svirt_sandbox_file_t }
- { 'path': /var/log/containers/swift, 'setype': svirt_sandbox_file_t }
- name: Check if rsyslog exists
shell: systemctl list-unit-files --type=service | grep -q rsyslog
register: rsyslog_config
failed_when: rsyslog_config.rc == 2
- 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: logconfig
- name: Restart rsyslogd service after logging conf change
service: name=rsyslog state=restarted
deploy_steps_tasks:
- name: Configure rsyslog for swift-proxy
when: step|int == 1
block:
- name: Check if rsyslog exists
shell: systemctl list-unit-files --type=service | grep -q rsyslog
register: rsyslog_config
failed_when: rsyslog_config.rc == 2
- 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: logconfig
- name: Restart rsyslogd service after logging conf change
service: name=rsyslog state=restarted
when:
- logconfig is changed
when:
- logconfig is changed
when:
- rsyslog_config is changed
- rsyslog_config.rc == 0
- rsyslog_config is changed
- rsyslog_config.rc == 0
update_tasks:
- name: Check swift containers log folder/symlink exists
stat:

44
deployment/swift/swift-storage-container-puppet.yaml

@ -606,26 +606,6 @@ outputs:
Log files from swift containers can be found under
/var/log/containers/swift and /var/log/containers/httpd/swift-*.
ignore_errors: true
- name: Check if rsyslog exists
shell: systemctl list-unit-files --type=service | grep -q rsyslog
register: rsyslog_config
failed_when: rsyslog_config.rc == 2
- 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: logconfig
- name: Restart rsyslogd service after logging conf change
service: name=rsyslog state=restarted
when:
- logconfig is changed
when:
- rsyslog_config is changed
- rsyslog_config.rc == 0
- name: Set fact for SwiftRawDisks
set_fact:
swift_raw_disks: {get_param: SwiftRawDisks}
@ -645,6 +625,30 @@ outputs:
state: mounted
with_items: "{{ swift_raw_disks }}"
when: swift_raw_disks
deploy_steps_tasks:
- name: Configure rsyslog for swift-storage
when: step|int == 1
block:
- name: Check if rsyslog exists
shell: systemctl list-unit-files --type=service | grep -q rsyslog
register: rsyslog_config
failed_when: rsyslog_config.rc == 2
- 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: logconfig
- name: Restart rsyslogd service after logging conf change
service: name=rsyslog state=restarted
when:
- logconfig is changed
when:
- rsyslog_config is changed
- rsyslog_config.rc == 0
update_tasks:
- name: Ensure rsyncd pid file is absent
file:

1
environments/standalone/standalone-tripleo.yaml

@ -107,6 +107,7 @@ resource_registry:
OS::TripleO::Services::OpenStackClients: ../../deployment/clients/openstack-clients-baremetal-puppet.yaml
OS::TripleO::Services::Podman: ../../deployment/podman/podman-baremetal-ansible.yaml
OS::TripleO::Services::Redis: OS::Heat::None
OS::TripleO::Services::Rsyslog: ../../deployment/logging/rsyslog-baremetal-ansible.yaml
OS::TripleO::Services::SaharaApi: OS::Heat::None
OS::TripleO::Services::SaharaEngine: OS::Heat::None
OS::TripleO::Services::Tmpwatch: ../../deployment/logrotate/tmpwatch-install.yaml

3
environments/undercloud.yaml

@ -58,6 +58,9 @@ resource_registry:
# This line will drop in Stein when it becomes the default.
OS::TripleO::Services::Podman: ../deployment/podman/podman-baremetal-ansible.yaml
# https://bugs.launchpad.net/tripleo/+bug/1850562
OS::TripleO::Services::Rsyslog: ../deployment/logging/rsyslog-baremetal-ansible.yaml
# Undercloud HA services
OS::TripleO::Services::HAproxy: OS::Heat::None
OS::TripleO::Services::Keepalived: OS::Heat::None

5
releasenotes/notes/rsyslog-5dc93db5eb8fc953.yaml

@ -0,0 +1,5 @@
---
features:
- |
On undercloud and standalone, install rsyslog on the host by default.
See https://bugs.launchpad.net/tripleo/+bug/1850562

1
roles/Undercloud.yaml

@ -79,6 +79,7 @@
- OS::TripleO::Services::Podman
- OS::TripleO::Services::Redis
- OS::TripleO::Services::Rhsm
- OS::TripleO::Services::Rsyslog
- OS::TripleO::Services::Sshd
- OS::TripleO::Services::SwiftProxy
- OS::TripleO::Services::SwiftRingBuilder

1
roles_data_undercloud.yaml

@ -82,6 +82,7 @@
- OS::TripleO::Services::Podman
- OS::TripleO::Services::Redis
- OS::TripleO::Services::Rhsm
- OS::TripleO::Services::Rsyslog
- OS::TripleO::Services::Sshd
- OS::TripleO::Services::SwiftProxy
- OS::TripleO::Services::SwiftRingBuilder

2
sample-env-generator/standalone.yaml

@ -132,6 +132,8 @@ environments:
OS::TripleO::Services::MistralExecutor: OS::Heat::None
# Redis
OS::TripleO::Services::Redis: OS::Heat::None
# Rsyslog
OS::TripleO::Services::Rsyslog: ../../deployment/logging/rsyslog-baremetal-ansible.yaml
# Sahara
OS::TripleO::Services::SaharaApi: OS::Heat::None
OS::TripleO::Services::SaharaEngine: OS::Heat::None

Loading…
Cancel
Save