tripleo-heat-templates/deployment/undercloud/tempest-container-puppet.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

71 lines
2.2 KiB
YAML

heat_template_version: rocky
description: >
OpenStack containerized Tempest
parameters:
ContainerTempestImage:
description: image
type: string
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
ServiceData:
default: {}
description: Dictionary packing service data
type: json
ServiceNetMap:
default: {}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry. This
mapping overrides those in ServiceNetMapDefaults.
type: json
DefaultPasswords:
default: {}
type: json
RoleName:
default: ''
description: Role name on which the service is applied
type: string
RoleParameters:
default: {}
description: Parameters specific to the role
type: json
outputs:
role_data:
description: Role data for the tempest service
value:
# It just adds a fake tempest service so that it will be
# available on undercloud.
service_name: tempest
docker_config:
step_2:
tempest_init_logs:
image: &tempest_image {get_param: ContainerTempestImage}
net: none
privileged: false
user: root
volumes:
- /var/log/containers/tempest:/var/log/tempest:z
- /var/lib/tempestdata:/var/lib/tempest:z
command: ['/bin/bash', '-c', 'chown -R tempest:tempest /var/log/tempest /var/lib/tempest']
host_prep_tasks:
- name: create persistent directories
file:
path: "{{ item.path }}"
state: directory
setype: "{{ item.setype }}"
mode: "{{ item.mode|default(omit) }}"
with_items:
- { 'path': /var/log/containers/tempest, 'setype': container_file_t, 'mode': '0750' }
- { 'path': /var/lib/tempestdata, 'setype': container_file_t }
- { 'path': /var/lib/tempest, 'setype': container_file_t }
puppet_config:
config_volume: ''
step_config: ''
config_image: {get_param: ContainerTempestImage}
config_settings: {}