Merge "Run chown for nova log files on every run to fix wrong permissions"

This commit is contained in:
Zuul 2019-03-19 10:29:56 +00:00 committed by Gerrit Code Review
commit e0177734e7
3 changed files with 35 additions and 0 deletions

View File

@ -7,6 +7,12 @@ parameters:
DockerNovaApiImage:
description: image
type: string
DeployIdentifier:
default: ''
type: string
description: >
Setting this to a unique value will re-run any deployment tasks which
perform configuration on a Heat stack-update.
outputs:
config_settings:
@ -29,6 +35,13 @@ outputs:
user: root
volumes: *nova_api_volumes
command: ['/bin/bash', '-c', 'chown -R nova:nova /var/log/nova']
environment:
# NOTE: this should force this container to re-run on each
# update (scale-out, etc.)
- list_join:
- ''
- - 'TRIPLEO_DEPLOY_IDENTIFIER='
- {get_param: DeployIdentifier}
host_prep_tasks:
description: Extra ansible tasks needed for logging to files in the host.
value:

View File

@ -10,6 +10,12 @@ parameters:
NovaServiceName:
description: service name
type: string
DeployIdentifier:
default: ''
type: string
description: >
Setting this to a unique value will re-run any deployment tasks which
perform configuration on a Heat stack-update.
resources:
@ -47,6 +53,13 @@ outputs:
volumes:
- /var/log/containers/nova:/var/log/nova:z
command: ['/bin/bash', '-c', 'chown -R nova:nova /var/log/nova']
environment:
# NOTE: this should force this container to re-run on each
# update (scale-out, etc.)
- list_join:
- ''
- - 'TRIPLEO_DEPLOY_IDENTIFIER='
- {get_param: DeployIdentifier}
- keys:
CONTAINERNAME: {get_attr: [InitLogContainerName, value]}
host_prep_tasks:

View File

@ -0,0 +1,9 @@
---
fixes:
- |
If nova-manage command was triggered on a host for the first time as root
(usually manual runs) the nova-manage.log gets created as root user. On
overcloud deploy runs the nova-manage command is run as nova user. In such
situation the overcloud deploy fails as the nova user can not write to the
nova-manage.log. With this change we run the chown of the logs files on
every overcloud deploy to fix the nova-manage.log file permissions.