Browse Source

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.

Patch slighly adjusted for the backport as step_1 refactoring doesn't
exist in stein and neither does container-puppet.sh.

Closes-Bug: #1853156
Change-Id: I26406da82c584dc5093c17ad26f263057a5cbcaa
(cherry picked from commit 10a523a03d)
(cherry picked from commit 3c71c99d7c)
changes/61/695861/1
Sofer Athlan-Guyot 2 years ago
parent
commit
886c51549f
  1. 10
      common/deploy-steps-tasks-step-0.j2.yaml
  2. 15
      common/deploy-steps.j2

10
common/deploy-steps-tasks-step-0.j2.yaml

@ -0,0 +1,10 @@
- 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
{%- for role in roles %}
- import_tasks: {{role.name}}/deploy_steps_tasks.yaml
when: tripleo_role_name == '{{role.name}}'
{%- endfor %}

15
common/deploy-steps.j2

@ -239,6 +239,7 @@ outputs:
deploy_steps_max: {{deploy_steps_max}}
ssh_known_hosts: {get_param: ssh_known_hosts_hostnames}
common_deploy_steps_tasks: {get_file: deploy-steps-tasks.yaml}
deploy_steps_tasks_step_0: {get_file: deploy-steps-tasks-step-0.yaml}
docker_puppet_script: {get_file: ./container-puppet.py}
deploy_steps_playbook:
str_replace:
@ -314,16 +315,7 @@ outputs:
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
tasks:
- 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
{%- 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
@ -559,6 +551,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
- include_tasks: common_deploy_steps_tasks.yaml
with_sequence: start=1 end={{deploy_steps_max-1}}
loop_control:

Loading…
Cancel
Save