Fix idempotency for horizon container logs

Whenever /var/log/horizon/horizon.log recreated as a root,
the touch command fails, and the chown commands got skipped.
This results in idempotency issues when the logs path become
accessed under mismatching user.

Fix this by making the chown command always applying disregard
of the touch command results.

Closes-Bug: #1819626

Change-Id: Ied538dbc7dbd311361108747a1e89d1f5740eedd
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
(cherry picked from commit 95e142d84e)
This commit is contained in:
Bogdan Dobrelya 2019-03-12 11:38:51 +01:00
parent f34e27928e
commit 0fc5b0efc8
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ outputs:
# FIXME Apache needs to read files in /etc/openstack-dashboard
# Need to set permissions to match the BM case,
# http://paste.openstack.org/show/609819/
command: ['/bin/bash', '-c', 'touch /var/log/horizon/horizon.log && chown -R apache:apache /var/log/horizon && chmod -R a+rx /etc/openstack-dashboard']
command: ['/bin/bash', '-c', 'touch /var/log/horizon/horizon.log ; chown -R apache:apache /var/log/horizon && chmod -R a+rx /etc/openstack-dashboard']
volumes:
- /var/log/containers/horizon:/var/log/horizon
- /var/log/containers/httpd/horizon:/var/log/httpd