Merge "Generate container startup configs with a new module" into stable/train

This commit is contained in:
Zuul 2020-07-16 23:31:24 +00:00 committed by Gerrit Code Review
commit ae13171da0
3 changed files with 3 additions and 69 deletions

View File

@ -1,28 +0,0 @@
---
# TODO(emilien) convert this whole task in a module
# https://bugs.launchpad.net/tripleo/+bug/1884577
- name: "Remove old {{ item.0 }} container startup configs"
become: true
file:
path: "/var/lib/tripleo-config/container-startup-config/{{ item.0 }}"
state: absent
- name: "Create directory for {{ item.0 }} container startup configs"
file:
path: "/var/lib/tripleo-config/container-startup-config/{{ item.0 }}/"
mode: 0600
recurse: yes
setype: svirt_sandbox_file_t
- name: "Creating container startup configs for {{ item.0 }}"
become: true
copy:
content: "{{ startup_data.value | to_nice_json }}"
dest: "/var/lib/tripleo-config/container-startup-config/{{ item.0 }}/{{ startup_data.key }}.json"
setype: container_file_t
mode: 0600
no_log: true
loop_control:
loop_var: startup_data
loop: "{{ item.1 | dict2items }}"

View File

@ -242,26 +242,6 @@
tags:
- container_config_scripts
# Here we are dumping all the container startup configuration data
# so that we can have access to how they are started outside of heat
# and container cmd. This lets us create command line tools to test containers.
- name: Set container_config_default fact
no_log: True
set_fact:
container_config_default: "{{ container_config_default | default({}) | combine( {'step_' + item: {}} ) }}"
with_sequence: count={{ deploy_steps_max }}
tags:
- container_startup_configs
- name: Set container_startup_configs_with_default fact
no_log: True
set_fact:
container_config_with_default: "{{ container_config_default | combine(role_data_container_config) }}"
vars:
role_data_container_config: "{{ lookup('file', tripleo_role_name + '/docker_config.yaml', errors='ignore') | default({}, True) | from_yaml }}"
tags:
- container_startup_configs
# 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
@ -276,27 +256,10 @@
tags:
- container_startup_configs
# For backward compatibility, the files are still generated.
# However, container_puppet.py won't create their hashed version if
# config changed.
- name: Write per-step container startup configs for backward compatibility
become: true
no_log: True
copy:
content: "{{ item[1] | to_nice_json }}"
dest: /var/lib/tripleo-config/container-startup-config-{{ item[0] }}.json
force: yes
mode: '0600'
loop: "{{ container_config_with_default | dictsort }}"
loop_control:
label: "{{ item[0] }}"
tags:
- container_startup_configs
- name: Generate startup configs files per step and per container
no_log: True
include_tasks: container_startup_configs_tasks.yaml
loop: "{{ container_config_with_default | dictsort }}"
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

View File

@ -398,7 +398,6 @@ outputs:
hiera_steps_tasks: {get_file: hiera-steps-tasks.yaml}
deploy_steps_tasks_step_0: {get_file: deploy-steps-tasks-step-0.yaml}
common_deploy_steps_tasks_step_1: {get_file: deploy-steps-tasks-step-1.yaml}
container_startup_configs_tasks: {get_file: container_startup_configs_tasks.yaml}
docker_puppet_script: {get_file: ./container-puppet.py}
container_puppet_script: {get_file: ./container-puppet.sh}
all_nodes_validation_script.sh : {get_file: ../validation-scripts/all-nodes.sh}