Ensure persistence for containerized rsyslog state

State files to be persisted under /var/lib/rsyslog.container to not
conflict with the rsyslog running at the host. Those may be position
files for file input tracking, journal position file, and buffers
for Elasticsearch output buffering, if needed.

Change-Id: I8c33e1c58c5e13ec1aea5d66fa437c1e8b21f8d5
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya 2019-07-30 17:26:51 +02:00
parent c74e31dec1
commit 304ffecd80
1 changed files with 8 additions and 1 deletions

View File

@ -212,6 +212,7 @@ outputs:
- /var/lib/config-data/puppet-generated/rsyslog/:/var/lib/kolla/config_files/src:ro
- /var/log/containers:/var/log/containers:ro
- /var/log/containers/rsyslog:/var/log/rsyslog:rw,z
- /var/lib/rsyslog.container:/var/lib/rsyslog:rw,z
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
host_prep_tasks:
@ -220,10 +221,16 @@ outputs:
path: /var/log/containers/rsyslog
state: directory
setype: svirt_sandbox_file_t
- name: create persistent state directory for rsyslog
file:
path: /var/lib/rsyslog.container
state: directory
setype: svirt_sandbox_file_t
- name: rsyslog logs readme
copy:
dest: /var/log/rsyslog/readme.txt
content: |
Log files from rsyslog containers can be found under
/var/log/containers/rsyslog.
/var/log/containers/rsyslog. And its state is stored
under /var/lib/rsyslog.container.
ignore_errors: true