Prevent skip package fact to run on all steps.

We refactor it into a vars for the task for upgrade and update tasks.

Partial-Bug: #1886932

Change-Id: I980f633989e74ca14784d5985b447334027603b8
This commit is contained in:
Sofer Athlan-Guyot 2020-07-04 00:08:36 +02:00
parent 9d9c5846ca
commit e75d05263c

View File

@ -421,9 +421,6 @@ outputs:
- step|int == 3 - step|int == 3
- os_net_config_need_upgrade.stdout - os_net_config_need_upgrade.stdout
- os_net_config_has_config.rc == 0 - os_net_config_has_config.rc == 0
- name: Set boolean skip_package_update
set_fact:
skip_package_update: {get_param: SkipPackageUpdate}
# Exclude ansible until https://github.com/ansible/ansible/issues/56636 # Exclude ansible until https://github.com/ansible/ansible/issues/56636
# is available # is available
- name: Update all packages - name: Update all packages
@ -434,6 +431,8 @@ outputs:
name: '*' name: '*'
state: latest state: latest
exclude: ansible exclude: ansible
vars:
skip_package_update: {get_param: SkipPackageUpdate}
external_upgrade_tasks: external_upgrade_tasks:
- name: Clean up upgrade artifacts - name: Clean up upgrade artifacts
when: step|int == 1 when: step|int == 1
@ -466,9 +465,6 @@ outputs:
- name: Exit if existing yum process - name: Exit if existing yum process
fail: msg="ERROR existing yum.pid detected - can't continue! Please ensure there is no other package update process for the duration of the minor update worfklow. Exiting." fail: msg="ERROR existing yum.pid detected - can't continue! Please ensure there is no other package update process for the duration of the minor update worfklow. Exiting."
when: (step|int == 0 or step|int == 3) and yum_pid_file.stat.exists when: (step|int == 0 or step|int == 3) and yum_pid_file.stat.exists
- name: Set boolean skip_package_update
set_fact:
skip_package_update: {get_param: SkipPackageUpdate}
# Exclude ansible until https://github.com/ansible/ansible/issues/56636 # Exclude ansible until https://github.com/ansible/ansible/issues/56636
# is available # is available
- name: Update all packages - name: Update all packages
@ -479,6 +475,8 @@ outputs:
name: '*' name: '*'
state: latest state: latest
exclude: ansible exclude: ansible
vars:
skip_package_update: {get_param: SkipPackageUpdate}
# This is failsafe unless openvswitch package does something to the systemd service state. # This is failsafe unless openvswitch package does something to the systemd service state.
- name: Ensure openvswitch is running after update - name: Ensure openvswitch is running after update
when: step|int == 3 when: step|int == 3