From 7133394c35219966fea301bc779f0981808e38e6 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 8 Feb 2019 10:38:10 +0100 Subject: [PATCH] Be able to know when we are running inside a minor update workflow With this change we add an ansible variable called 'tripleo_minor_update' set to true only during the update_steps_playbook which get run during a minor update. Then inside common/deploy-steps-tasks when starting containers with paunch we export this 'tripleo_minor_update' ansible variable and push it inside the 'TRIPLEO_MINOR_UPDATE' environment variable. Inside change Id1d671506d3ec827bc311b47d9363952e1239ce3 we will then use the env variable and export it to the restart_bundles in order to detect if we're inside a minor update workflow (as opposed to a redeploy - aka stack update). The testing that has been done is described in the above change. Co-Authored-By: Damien Ciabrini Change-Id: Ib3562adbd83f7162c2aeb450329b7cc4ab200fc2 --- common/deploy-steps-tasks.yaml | 2 ++ common/deploy-steps.j2 | 1 + releasenotes/notes/minor-update-env-20657417094d4aeb.yaml | 7 +++++++ 3 files changed, 10 insertions(+) create mode 100644 releasenotes/notes/minor-update-env-20657417094d4aeb.yaml diff --git a/common/deploy-steps-tasks.yaml b/common/deploy-steps-tasks.yaml index 2960fa6d80..9627122145 100644 --- a/common/deploy-steps-tasks.yaml +++ b/common/deploy-steps-tasks.yaml @@ -470,6 +470,8 @@ # we have new paunch version related to # https://review.openstack.org/#/c/635438/ - name: Start containers for step {{ step }} + environment: + TRIPLEO_MINOR_UPDATE: '{{ tripleo_minor_update | default(false) }}' command: >- paunch {% if enable_debug|bool %}--debug{% else %}-v{% endif %} apply --default-runtime "{{ container_cli }}" diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2 index 74c6d05e61..59a357968d 100644 --- a/common/deploy-steps.j2 +++ b/common/deploy-steps.j2 @@ -504,6 +504,7 @@ outputs: docker_puppet_debug: DOCKER_PUPPET_DEBUG docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET + tripleo_minor_update: true tasks: - include_tasks: update_steps_tasks.yaml with_sequence: start=0 end={{update_steps_max-1}} diff --git a/releasenotes/notes/minor-update-env-20657417094d4aeb.yaml b/releasenotes/notes/minor-update-env-20657417094d4aeb.yaml new file mode 100644 index 0000000000..e144942f5e --- /dev/null +++ b/releasenotes/notes/minor-update-env-20657417094d4aeb.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + It is now possible for temporary containers inside THT to test if they are being run + as part of a minor update by checking if the TRIPLEO_MINOR_UPDATE environment + variable is set to 'true' (said containers need to export it to the container explicitely), + see _restart_bundles for examples.