tripleo-heat-templates/deployment/logging/files/nova-libvirt.yaml
Jose Luis Franco Arza 94bc023390 Add mode option when creating persistent directories.
Almost every single tripleo service creates a persistent directory. To
simplify the creation, a with_items structure was being used. In which
many times, the mode option was being set. However, that mode option
was not taken into account at the time of creating the file. As a
consequence, the directory was being created with its father directory
rights, instead of the ones being passed in the template.

Change-Id: I215db2bb79029c19ab8c62a7ae8d93cec50fb8dc
Closes-Bug: #1871231
2020-04-20 15:37:08 +02:00

56 lines
1.8 KiB
YAML

heat_template_version: rocky
description: >
OpenStack containerized Nova libvirt service
parameters:
LibvirtLogLevel:
default: 3
description: Defines log level in libvirt to filter log output.
See https://libvirt.org/logging.html to find its detail.
type: number
constraints:
- range: { min: 1, max: 4 }
LibvirtVirtlogdLogLevel:
default: 3
description: Defines log level in virtlogd to filter log output.
See https://libvirt.org/logging.html to find its detail.
type: number
constraints:
- range: { min: 1, max: 4 }
outputs:
config_settings:
description: Extra hieradata needed to log to files in the host.
value:
nova::compute::libvirt::log_outputs:
str_replace:
template:
'LEVEL:file:/var/log/libvirt/libvirtd.log'
params:
LEVEL: {get_param: LibvirtLogLevel}
nova::compute::libvirt::virtlogd::log_outputs:
str_replace:
template:
'LEVEL:file:/var/log/libvirt/virtlogd.log'
params:
LEVEL: {get_param: LibvirtVirtlogdLogLevel}
volumes:
description: The volumes needed to log to files in the host.
value:
- /var/log/containers/libvirt:/var/log/libvirt:z
docker_config:
description: Extra containers needed for logging to file in the host.
value: null
host_prep_tasks:
description: Extra ansible tasks needed for logging to files in the host.
value:
- name: create persistent directories
file:
path: "{{ item.path }}"
setype: "{{ item.setype }}"
state: directory
mode: "{{ item.mode }}"
with_items:
- { 'path': /var/log/containers/libvirt, 'setype': container_file_t, 'mode': '0750' }