76adfd4202
In ansible, usage of true/false for boolean values, instead of yes/no, is considered as a best practise and is enforced by ansible-lint with the "truthy value should be one of false, true (truthy)" rule. This change replaces usage of yes/no by true/false to follow that practise. Change-Id: I3313278f1ef6cbee0f906aca0a77bde1a3c53784
105 lines
2.8 KiB
YAML
105 lines
2.8 KiB
YAML
- name: Create and ensure setype for /var/log/containers directory
|
|
become: true
|
|
file:
|
|
path: /var/log/containers
|
|
state: directory
|
|
setype: container_file_t
|
|
selevel: s0
|
|
mode: 0750
|
|
tags:
|
|
- host_config
|
|
|
|
- name: Create ContainerLogStdoutPath directory
|
|
become: true
|
|
file:
|
|
path: "{{ container_log_stdout_path }}"
|
|
state: directory
|
|
selevel: s0
|
|
tags:
|
|
- host_config
|
|
|
|
- name: Create /var/lib/tripleo-config directory
|
|
become: true
|
|
file:
|
|
path: /var/lib/tripleo-config
|
|
state: directory
|
|
setype: container_file_t
|
|
selevel: s0
|
|
recurse: true
|
|
tags:
|
|
- host_config
|
|
- container_config
|
|
- container_config_tasks
|
|
- container_config_scripts
|
|
- container_startup_configs
|
|
|
|
# The container config files
|
|
# /var/lib/container-startup-configs.json is removed as we now write
|
|
# per-step files instead
|
|
- name: Clean old /var/lib/container-startup-configs.json file
|
|
become: true
|
|
file:
|
|
path: /var/lib/container-startup-configs.json
|
|
state: absent
|
|
tags:
|
|
- container_startup_configs
|
|
|
|
# For legacy, can be removed in Train cycle
|
|
- name: Clean old /var/lib/docker-container-startup-configs.json file
|
|
become: true
|
|
file:
|
|
path: /var/lib/docker-container-startup-configs.json
|
|
state: absent
|
|
tags:
|
|
- container_startup_configs
|
|
|
|
- import_tasks: common_container_config_scripts.yaml
|
|
|
|
# This file location is deprecated and the new location is now:
|
|
# /var/lib/tripleo-config/container-startup-config/step_X/<container_name>.json
|
|
# Can be removed in V cycle
|
|
- name: Write /var/lib/tripleo-config/container-startup-config-readme.txt
|
|
become: true
|
|
no_log: True
|
|
copy:
|
|
content: "Container startup configs moved to /var/lib/tripleo-config/container-startup-config"
|
|
dest: /var/lib/tripleo-config/container-startup-config-readme.txt
|
|
force: true
|
|
mode: '0600'
|
|
tags:
|
|
- container_startup_configs
|
|
|
|
- name: Generate startup configs files per step and per container
|
|
become: true
|
|
container_startup_config:
|
|
config_base_dir: /var/lib/tripleo-config/container-startup-config
|
|
config_data: "{{ lookup('file', (tripleo_role_name + '/docker_config.yaml'), errors='ignore') | default({}, True) | from_yaml }}"
|
|
tags:
|
|
- container_startup_configs
|
|
|
|
- name: Create /var/lib/kolla/config_files directory
|
|
become: true
|
|
file:
|
|
path: /var/lib/kolla/config_files
|
|
state: directory
|
|
setype: container_file_t
|
|
selevel: s0
|
|
recurse: true
|
|
tags:
|
|
- container_startup_configs
|
|
|
|
- name: Create /var/lib/config-data directory
|
|
become: true
|
|
file:
|
|
path: /var/lib/config-data
|
|
state: directory
|
|
setype: container_file_t
|
|
selevel: s0
|
|
|
|
- name: Write container config json files
|
|
become: true
|
|
tripleo_container_configs:
|
|
config_data: "{{ lookup('file', tripleo_role_name + '/kolla_config.yaml', errors='ignore') | default({}, True) | from_yaml }}"
|
|
tags:
|
|
- container_startup_configs
|