Install and start Rsyslog on the Undercloud & Standalone
Create a new Rsyslog service that is deployed on the host (not in a container) and with Ansible. Make it so it's deployed by default on Undercloud & Standalone setups. Also move the tasks that configure rsyslogd for HAproxy & Swift to be executed after the host prep tasks (using deploy step tasks). Change-Id: I027c64aefcc4715da17836a5cf0141152cf146aa Closes-Bug: #1850562
This commit is contained in:
parent
67fd68d7c2
commit
5ff628f1cf
|
@ -286,6 +286,31 @@ outputs:
|
||||||
environment:
|
environment:
|
||||||
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
|
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
|
||||||
deploy_steps_tasks:
|
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
|
- name: Run puppet on the host to apply IPtables rules
|
||||||
when: step|int == 1
|
when: step|int == 1
|
||||||
shell: |
|
shell: |
|
||||||
|
@ -341,28 +366,6 @@ outputs:
|
||||||
tripleo_delegate_to: "{{ groups['haproxy'] | default([]) }}"
|
tripleo_delegate_to: "{{ groups['haproxy'] | default([]) }}"
|
||||||
host_prep_tasks:
|
host_prep_tasks:
|
||||||
- {get_attr: [HAProxyPublicTLS, role_data, 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
|
- name: create persistent directories
|
||||||
file:
|
file:
|
||||||
path: "{{ item.path }}"
|
path: "{{ item.path }}"
|
||||||
|
|
|
@ -287,28 +287,13 @@ outputs:
|
||||||
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
|
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
|
||||||
host_prep_tasks:
|
host_prep_tasks:
|
||||||
- {get_attr: [HAProxyBase, role_data, host_prep_tasks]}
|
- {get_attr: [HAProxyBase, role_data, host_prep_tasks]}
|
||||||
- name: Check if rsyslog exists
|
- name: haproxy logs readme
|
||||||
shell: systemctl is-active rsyslog
|
copy:
|
||||||
register: rsyslog_config
|
dest: /var/log/haproxy/readme.txt
|
||||||
- when:
|
content: |
|
||||||
- rsyslog_config is changed
|
Log files from the haproxy containers can be found under
|
||||||
- rsyslog_config.rc == 0
|
/var/log/containers/haproxy.
|
||||||
block:
|
ignore_errors: true
|
||||||
- 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
|
- name: create persistent directories
|
||||||
file:
|
file:
|
||||||
path: "{{ item.path }}"
|
path: "{{ item.path }}"
|
||||||
|
@ -318,16 +303,34 @@ outputs:
|
||||||
- { 'path': /var/log/containers/haproxy, 'setype': var_log_t }
|
- { 'path': /var/log/containers/haproxy, 'setype': var_log_t }
|
||||||
- { 'path': /var/lib/haproxy, 'setype': svirt_sandbox_file_t }
|
- { 'path': /var/lib/haproxy, 'setype': svirt_sandbox_file_t }
|
||||||
- { 'path': /var/log/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:
|
metadata_settings:
|
||||||
{get_attr: [HAProxyBase, role_data, metadata_settings]}
|
{get_attr: [HAProxyBase, role_data, metadata_settings]}
|
||||||
deploy_steps_tasks:
|
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
|
- name: HAproxy tag container image for pacemaker
|
||||||
when: step|int == 1
|
when: step|int == 1
|
||||||
import_role:
|
import_role:
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -438,26 +438,30 @@ outputs:
|
||||||
- { 'path': /srv/node, 'setype': svirt_sandbox_file_t }
|
- { 'path': /srv/node, 'setype': svirt_sandbox_file_t }
|
||||||
- { 'path': /var/log/swift, 'setype': svirt_sandbox_file_t }
|
- { 'path': /var/log/swift, 'setype': svirt_sandbox_file_t }
|
||||||
- { 'path': /var/log/containers/swift, 'setype': svirt_sandbox_file_t }
|
- { 'path': /var/log/containers/swift, 'setype': svirt_sandbox_file_t }
|
||||||
- name: Check if rsyslog exists
|
deploy_steps_tasks:
|
||||||
shell: systemctl list-unit-files --type=service | grep -q rsyslog
|
- name: Configure rsyslog for swift-proxy
|
||||||
register: rsyslog_config
|
when: step|int == 1
|
||||||
failed_when: rsyslog_config.rc == 2
|
block:
|
||||||
- block:
|
- name: Check if rsyslog exists
|
||||||
- name: Forward logging to swift.log file
|
shell: systemctl list-unit-files --type=service | grep -q rsyslog
|
||||||
copy:
|
register: rsyslog_config
|
||||||
content: |
|
failed_when: rsyslog_config.rc == 2
|
||||||
# Fix for https://bugs.launchpad.net/tripleo/+bug/1776180
|
- block:
|
||||||
local2.* /var/log/containers/swift/swift.log
|
- name: Forward logging to swift.log file
|
||||||
& stop
|
copy:
|
||||||
dest: /etc/rsyslog.d/openstack-swift.conf
|
content: |
|
||||||
register: logconfig
|
# Fix for https://bugs.launchpad.net/tripleo/+bug/1776180
|
||||||
- name: Restart rsyslogd service after logging conf change
|
local2.* /var/log/containers/swift/swift.log
|
||||||
service: name=rsyslog state=restarted
|
& 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:
|
when:
|
||||||
- logconfig is changed
|
- rsyslog_config is changed
|
||||||
when:
|
- rsyslog_config.rc == 0
|
||||||
- rsyslog_config is changed
|
|
||||||
- rsyslog_config.rc == 0
|
|
||||||
update_tasks:
|
update_tasks:
|
||||||
- name: Check swift containers log folder/symlink exists
|
- name: Check swift containers log folder/symlink exists
|
||||||
stat:
|
stat:
|
||||||
|
|
|
@ -606,26 +606,6 @@ outputs:
|
||||||
Log files from swift containers can be found under
|
Log files from swift containers can be found under
|
||||||
/var/log/containers/swift and /var/log/containers/httpd/swift-*.
|
/var/log/containers/swift and /var/log/containers/httpd/swift-*.
|
||||||
ignore_errors: true
|
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
|
- name: Set fact for SwiftRawDisks
|
||||||
set_fact:
|
set_fact:
|
||||||
swift_raw_disks: {get_param: SwiftRawDisks}
|
swift_raw_disks: {get_param: SwiftRawDisks}
|
||||||
|
@ -645,6 +625,30 @@ outputs:
|
||||||
state: mounted
|
state: mounted
|
||||||
with_items: "{{ swift_raw_disks }}"
|
with_items: "{{ swift_raw_disks }}"
|
||||||
when: 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:
|
update_tasks:
|
||||||
- name: Ensure rsyncd pid file is absent
|
- name: Ensure rsyncd pid file is absent
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -107,6 +107,7 @@ resource_registry:
|
||||||
OS::TripleO::Services::OpenStackClients: ../../deployment/clients/openstack-clients-baremetal-puppet.yaml
|
OS::TripleO::Services::OpenStackClients: ../../deployment/clients/openstack-clients-baremetal-puppet.yaml
|
||||||
OS::TripleO::Services::Podman: ../../deployment/podman/podman-baremetal-ansible.yaml
|
OS::TripleO::Services::Podman: ../../deployment/podman/podman-baremetal-ansible.yaml
|
||||||
OS::TripleO::Services::Redis: OS::Heat::None
|
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::SaharaApi: OS::Heat::None
|
||||||
OS::TripleO::Services::SaharaEngine: OS::Heat::None
|
OS::TripleO::Services::SaharaEngine: OS::Heat::None
|
||||||
OS::TripleO::Services::Tmpwatch: ../../deployment/logrotate/tmpwatch-install.yaml
|
OS::TripleO::Services::Tmpwatch: ../../deployment/logrotate/tmpwatch-install.yaml
|
||||||
|
|
|
@ -58,6 +58,9 @@ resource_registry:
|
||||||
# This line will drop in Stein when it becomes the default.
|
# This line will drop in Stein when it becomes the default.
|
||||||
OS::TripleO::Services::Podman: ../deployment/podman/podman-baremetal-ansible.yaml
|
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
|
# Undercloud HA services
|
||||||
OS::TripleO::Services::HAproxy: OS::Heat::None
|
OS::TripleO::Services::HAproxy: OS::Heat::None
|
||||||
OS::TripleO::Services::Keepalived: OS::Heat::None
|
OS::TripleO::Services::Keepalived: OS::Heat::None
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
On undercloud and standalone, install rsyslog on the host by default.
|
||||||
|
See https://bugs.launchpad.net/tripleo/+bug/1850562
|
|
@ -79,6 +79,7 @@
|
||||||
- OS::TripleO::Services::Podman
|
- OS::TripleO::Services::Podman
|
||||||
- OS::TripleO::Services::Redis
|
- OS::TripleO::Services::Redis
|
||||||
- OS::TripleO::Services::Rhsm
|
- OS::TripleO::Services::Rhsm
|
||||||
|
- OS::TripleO::Services::Rsyslog
|
||||||
- OS::TripleO::Services::Sshd
|
- OS::TripleO::Services::Sshd
|
||||||
- OS::TripleO::Services::SwiftProxy
|
- OS::TripleO::Services::SwiftProxy
|
||||||
- OS::TripleO::Services::SwiftRingBuilder
|
- OS::TripleO::Services::SwiftRingBuilder
|
||||||
|
|
|
@ -82,6 +82,7 @@
|
||||||
- OS::TripleO::Services::Podman
|
- OS::TripleO::Services::Podman
|
||||||
- OS::TripleO::Services::Redis
|
- OS::TripleO::Services::Redis
|
||||||
- OS::TripleO::Services::Rhsm
|
- OS::TripleO::Services::Rhsm
|
||||||
|
- OS::TripleO::Services::Rsyslog
|
||||||
- OS::TripleO::Services::Sshd
|
- OS::TripleO::Services::Sshd
|
||||||
- OS::TripleO::Services::SwiftProxy
|
- OS::TripleO::Services::SwiftProxy
|
||||||
- OS::TripleO::Services::SwiftRingBuilder
|
- OS::TripleO::Services::SwiftRingBuilder
|
||||||
|
|
|
@ -132,6 +132,8 @@ environments:
|
||||||
OS::TripleO::Services::MistralExecutor: OS::Heat::None
|
OS::TripleO::Services::MistralExecutor: OS::Heat::None
|
||||||
# Redis
|
# Redis
|
||||||
OS::TripleO::Services::Redis: OS::Heat::None
|
OS::TripleO::Services::Redis: OS::Heat::None
|
||||||
|
# Rsyslog
|
||||||
|
OS::TripleO::Services::Rsyslog: ../../deployment/logging/rsyslog-baremetal-ansible.yaml
|
||||||
# Sahara
|
# Sahara
|
||||||
OS::TripleO::Services::SaharaApi: OS::Heat::None
|
OS::TripleO::Services::SaharaApi: OS::Heat::None
|
||||||
OS::TripleO::Services::SaharaEngine: OS::Heat::None
|
OS::TripleO::Services::SaharaEngine: OS::Heat::None
|
||||||
|
|
Loading…
Reference in New Issue