Make sure glance_api_tls_proxy logs are persisted on the host

The logs for the glance_api_tls_proxy containers are not persisted on
the host and hence get lost at the restart of the container.  Said
container has httpd inside of it so we need to make sure that the httpd
logs are persisted on the host just like the other containers that use
httpd.

Tested this review and I correctly get the logs persisted on a
TLS-everywhere environment:
[root@controller-0 ~]# ls -l /var/log/containers/httpd/glance/
total 1040
-rw-r--r--. 1 root root   5864 Nov 28 10:07 error_log
-rw-r--r--. 1 root root 544043 Nov 28 11:17 glance-api-proxy_access_ssl.log
-rw-r--r--. 1 root root   4360 Nov 28 10:07 glance-api-proxy_error_ssl.log

Change-Id: Id4f24e171867adc445eca55b3908360c8f3f6f30
Closes-Bug: #1854343
This commit is contained in:
Michele Baldessari 2019-11-28 12:16:05 +01:00
parent 9af663bc20
commit f22dce4477
2 changed files with 3 additions and 0 deletions

View File

@ -572,6 +572,7 @@ outputs:
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
- {get_attr: [GlanceLogging, volumes]}
-
- /var/lib/kolla/config_files/glance_api_tls_proxy.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/glance_api/:/var/lib/kolla/config_files/src:ro

View File

@ -16,6 +16,7 @@ outputs:
description: The volumes needed to log to files in the host.
value: &glance_api_volumes
- /var/log/containers/glance:/var/log/glance:z
- /var/log/containers/httpd/glance:/var/log/httpd:z
docker_config:
description: Extra containers needed for logging to files in the host.
value:
@ -38,3 +39,4 @@ outputs:
setype: "{{ item.setype }}"
with_items:
- { 'path': /var/log/containers/glance, 'setype': svirt_sandbox_file_t, 'mode': '0750' }
- { 'path': /var/log/containers/httpd/glance, 'setype': svirt_sandbox_file_t, 'mode': '0750' }