From 4ed5c76e46ff27c85c6849a0b14f0b934964b525 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Tue, 23 Jun 2020 17:50:57 -0400 Subject: [PATCH] Generate container startup configs with a new module Remove container_startup_configs_tasks.yaml playbook, and some set_fact tasks that aren't needed anymore; since we now have a module to generate container startup config files. Change-Id: I8ebe7f5f52f14a14c3911748b2e2063e0c3ad9ac (cherry picked from commit c587d74ae192fa9562b42ed118fc946547a6c899) --- common/container_startup_configs_tasks.yaml | 26 --------------------- common/deploy-steps-tasks-step-1.yaml | 26 +++------------------ common/deploy-steps.j2 | 1 - 3 files changed, 3 insertions(+), 50 deletions(-) delete mode 100644 common/container_startup_configs_tasks.yaml diff --git a/common/container_startup_configs_tasks.yaml b/common/container_startup_configs_tasks.yaml deleted file mode 100644 index 6f04c36ca9..0000000000 --- a/common/container_startup_configs_tasks.yaml +++ /dev/null @@ -1,26 +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" - 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: container_file_t - -- name: "Creating container startup configs for {{ item.0 }}" - 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 }}" diff --git a/common/deploy-steps-tasks-step-1.yaml b/common/deploy-steps-tasks-step-1.yaml index f167f2f488..100a698e95 100644 --- a/common/deploy-steps-tasks-step-1.yaml +++ b/common/deploy-steps-tasks-step-1.yaml @@ -208,26 +208,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/.json # Can be removed in V cycle @@ -242,9 +222,9 @@ - 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 diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2 index d4451abd55..7cda5bb100 100644 --- a/common/deploy-steps.j2 +++ b/common/deploy-steps.j2 @@ -406,7 +406,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}