Browse Source

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 <dciabrin@redhat.com>

Related-Bug: #1823849

NB: Cherry-pick not 100% clean due to missing Ia630f08f553bd53656c76e5c8059f15d314a17c0
    and other missing reviews

Change-Id: Ib3562adbd83f7162c2aeb450329b7cc4ab200fc2
(cherry picked from commit 7133394c35)
changes/81/651181/1
Michele Baldessari 2 years ago
parent
commit
79eddd1552
  1. 2
      common/deploy-steps-tasks.yaml
  2. 2
      common/deploy-steps.j2
  3. 7
      releasenotes/notes/minor-update-env-20657417094d4aeb.yaml

2
common/deploy-steps-tasks.yaml

@ -317,6 +317,8 @@
# the *step_n.json with a hash of the generated external config added
# This acts as a salt to enable restarting the container if config changes
- name: Start containers for step {{step}}
environment:
TRIPLEO_MINOR_UPDATE: '{{ tripleo_minor_update | default(false) }}'
command: >-
paunch --debug apply
--file /var/lib/tripleo-config/hashed-docker-container-startup-config-step_{{step}}.json

2
common/deploy-steps.j2

@ -564,6 +564,8 @@ outputs:
name: Run update
serial: 1
gather_facts: no
vars:
tripleo_minor_update: true
tasks:
- include: update_steps_tasks.yaml
with_sequence: start=0 end={{update_steps_max-1}}

7
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 <service>_restart_bundles for examples.
Loading…
Cancel
Save