Browse Source

Stop using handlers for ovs

Move openvswitch handler tasks to the update and upgrade tasks.

Related-Bug: #1888853
Change-Id: I98bb188d6157326e41765fa3f77dcb47480c408b
changes/50/744250/4
Alex Schultz 2 years ago
parent
commit
dc7cf609ff
  1. 11
      tripleo_ansible/roles/tripleo_packages/molecule/upgrade/prepare.yml
  2. 2
      tripleo_ansible/roles/tripleo_packages/tasks/openvswitch.yml
  3. 8
      tripleo_ansible/roles/tripleo_packages/tasks/update.yml
  4. 11
      tripleo_ansible/roles/tripleo_packages/tasks/upgrade.yml

11
tripleo_ansible/roles/tripleo_packages/molecule/upgrade/prepare.yml

@ -17,7 +17,10 @@
- name: Prepare
hosts: all
roles:
- role: test_deps
test_deps_extra_packages:
- openvswitch
tasks:
- include_role:
name: test_deps
vars:
test_deps_setup_tripleo: true
test_deps_extra_packages:
- openvswitch

2
tripleo_ansible/roles/tripleo_packages/handlers/main.yml → tripleo_ansible/roles/tripleo_packages/tasks/openvswitch.yml

@ -26,7 +26,6 @@
changed_when: false
failed_when: false
register: openvswitch_service_state
listen: start openvswitch
- name: Ensure openvswitch is running
systemd:
@ -37,4 +36,3 @@
- (openvswitch_service_state.status is defined) and
(((openvswitch_service_state.status['LoadState'] | lower) != 'not-found') and
((openvswitch_service_state.status['SubState'] | lower) != 'running'))
listen: start openvswitch

8
tripleo_ansible/roles/tripleo_packages/tasks/update.yml

@ -38,4 +38,10 @@
name: '*'
state: latest
exclude: ansible
notify: start openvswitch
register: tripleo_package_update_result
- name: Handle openvswitch service
include_tasks: openvswitch.yml
when:
- step|int == 3
- tripleo_package_update_result.changed

11
tripleo_ansible/roles/tripleo_packages/tasks/upgrade.yml

@ -215,7 +215,7 @@
package:
name: rhosp-openvswitch
state: latest
notify: start openvswitch
register: tripleo_package_openvswitch_result
- name: set flag to skip other upgrade steps since OpenvSwitch is already upgraded!
set_fact:
@ -280,7 +280,14 @@
args:
chdir: /root/OVS_UPGRADE
loop: "{{ ovs_list_of_rpms.stdout_lines }}"
notify: "start openvswitch"
register: tripleo_package_openvswitch_result
- name: Start openvswitch
include_tasks: openvswitch.yml
when:
- (step|int) == 2
- tripleo_package_openvswitch_result is defined
- tripleo_package_openvswitch_result.changed
- name: Install libibverbs (https://bugs.launchpad.net/tripleo/+bug/1817743)
when:

Loading…
Cancel
Save