From 3c71c99d7c843ac87616621a4eb084b0852b65f8 Mon Sep 17 00:00:00 2001 From: Sofer Athlan-Guyot Date: Tue, 19 Nov 2019 18:06:28 +0100 Subject: [PATCH] Make sure we apply all deploy step-0 during update. That step include, in particular, the puppet-container.py/sh creation file plus some other task that should happen very early during the deploy process. During update if a change in puppet-container.py happen in the template we have to trigger those steps to get the changes. This is especially critical because we run puppet container configuration during the update stage. Closes-Bug: #1853156 Change-Id: I26406da82c584dc5093c17ad26f263057a5cbcaa (cherry picked from commit 10a523a03d6c6883015e620de52c64b85d20a188) --- common/deploy-steps-tasks-step-0.j2.yaml | 18 ++++++++++++++++++ common/deploy-steps.j2 | 22 +++++----------------- 2 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 common/deploy-steps-tasks-step-0.j2.yaml diff --git a/common/deploy-steps-tasks-step-0.j2.yaml b/common/deploy-steps-tasks-step-0.j2.yaml new file mode 100644 index 0000000000..4df9d24417 --- /dev/null +++ b/common/deploy-steps-tasks-step-0.j2.yaml @@ -0,0 +1,18 @@ +- name: Deploy step tasks for step 0 + debug: + msg: Use --start-at-task 'Deploy step tasks for step 0' to resume from this task + when: "tripleo_minor_update is not defined or tripleo_minor_update != 'true'" +- name: Create /var/lib/container-puppet + no_log: True + file: path=/var/lib/container-puppet state=directory setype=svirt_sandbox_file_t selevel=s0 recurse=true +- name: Write container-puppet.py + no_log: True + copy: src=docker_puppet_script.yaml dest=/var/lib/container-puppet/container-puppet.py force=yes mode=0600 +- name: Write container-puppet.sh + no_log: True + copy: src=container_puppet_script.yaml dest=/var/lib/container-puppet/container-puppet.sh force=yes mode=0755 + +{%- for role in roles %} +- import_tasks: {{role.name}}/deploy_steps_tasks.yaml + when: tripleo_role_name == '{{role.name}}' +{%- endfor %} diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2 index b449cf5224..23d44bf9b4 100644 --- a/common/deploy-steps.j2 +++ b/common/deploy-steps.j2 @@ -372,6 +372,7 @@ outputs: cloud_domain: {get_param: CloudDomain} all_nodes_extra_map_data: {get_param: AllNodesExtraMapData} common_deploy_steps_tasks: {get_file: deploy-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} docker_puppet_script: {get_file: ./container-puppet.py} container_puppet_script: {get_file: ./container-puppet.sh} @@ -492,23 +493,7 @@ outputs: docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET tasks: - - name: Overcloud deploy step tasks for step 0 - debug: - msg: Use --start-at-task "Overcloud deploy step tasks for step 0" to resume from this task - - name: Create /var/lib/container-puppet - no_log: True - file: path=/var/lib/container-puppet state=directory setype=svirt_sandbox_file_t selevel=s0 recurse=true - - name: Write container-puppet.py - no_log: True - copy: src=docker_puppet_script.yaml dest=/var/lib/container-puppet/container-puppet.py force=yes mode=0600 - - name: Write container-puppet.sh - no_log: True - copy: src=container_puppet_script.yaml dest=/var/lib/container-puppet/container-puppet.sh force=yes mode=0755 - -{%- for role in roles %} - - import_tasks: {{role.name}}/deploy_steps_tasks.yaml - when: tripleo_role_name == '{{role.name}}' -{%- endfor %} + - import_tasks: deploy_steps_tasks_step_0.yaml tags: - overcloud - deploy_steps @@ -957,6 +942,9 @@ outputs: loop_var: step - import_tasks: {{role.name}}/host_prep_tasks.yaml when: tripleo_role_name == '{{role.name}}' + - import_tasks: deploy_steps_tasks_step_0.yaml + vars: + step: 0 - import_tasks: common_deploy_steps_tasks_step_1.yaml - include_tasks: common_deploy_steps_tasks.yaml with_sequence: start=1 end={{deploy_steps_max-1}}