diff --git a/puppet/services/tripleo-packages.yaml b/puppet/services/tripleo-packages.yaml index 8d9fee2f46..11df8d0cdb 100644 --- a/puppet/services/tripleo-packages.yaml +++ b/puppet/services/tripleo-packages.yaml @@ -135,9 +135,13 @@ outputs: register: ovs_pkg_out shell: rpm -qa | awk -F- '/^(openvswitch[0-9]+\.[0-9]+-[0-9]+\.[0-9]+\.[-0]+-|openvswitch-2)/{print $1}' + when: + - step|int == 2 - name: Don't update if not present set_fact: run_ovs_update: "{{ (ovs_pkg_out.stdout | length) > 0 }}" + when: + - step|int == 2 - name: Block for gathering information for upgrading OpenvSwitch layered product packaging when: - step|int == 2 @@ -245,7 +249,9 @@ outputs: # do anything to prevent the systemd service from being removed and it is not # re-enabled by default by the new package. - name: Always ensure the openvswitch service is enabled and running after upgrades - when: step|int == 2 + when: + - step|int == 2 + - run_ovs_update|bool service: name: openvswitch enabled: yes @@ -326,9 +332,13 @@ outputs: register: ovs_pkg_out shell: rpm -qa | awk -F- '/^(openvswitch[0-9]+\.[0-9]+-[0-9]+\.[0-9]+\.[-0]+-|openvswitch-2)/{print $1}' + when: + - step|int == 2 or step|int == 3 - name: Don't update if not present set_fact: run_ovs_update: "{{ (ovs_pkg_out.stdout | length) > 0 }}" + when: + - step|int == 2 or step|int == 3 - name: Block for gathering information for upgrading OpenvSwitch layered product packaging when: - step|int == 2 @@ -415,7 +425,9 @@ outputs: update_cache: yes # This is failsafe unless openvswitch package does something to the systemd service state. - name: Ensure openvswitch is running after update - when: step|int == 3 + when: + - step|int == 3 + - run_ovs_update|bool service: name: openvswitch enabled: yes