From 8736817a989213df0f40a72f7e7163d9792aee43 Mon Sep 17 00:00:00 2001 From: David Rabel Date: Fri, 28 Sep 2018 12:59:36 +0200 Subject: [PATCH] openvswitch: always run handler to to ensure OVS bridges are up When editing external bridge configuration and running a reconfigure on openvswitch, handler "Ensuring OVS bridge is properly setup" needs to run, but doesn't. This moves the task from handlers to own file and always includes it after running the handlers. Change-Id: Iee39cf00b743ab0776354749c6e162814b5584d8 Closes-Bug: #1794504 --- ansible/roles/openvswitch/handlers/main.yml | 13 ------------- ansible/roles/openvswitch/tasks/deploy.yml | 2 ++ .../roles/openvswitch/tasks/ensure-ovs-bridge.yml | 12 ++++++++++++ ansible/roles/openvswitch/tasks/upgrade.yml | 2 ++ 4 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 ansible/roles/openvswitch/tasks/ensure-ovs-bridge.yml diff --git a/ansible/roles/openvswitch/handlers/main.yml b/ansible/roles/openvswitch/handlers/main.yml index 5fe102c270..dd26abd3ca 100644 --- a/ansible/roles/openvswitch/handlers/main.yml +++ b/ansible/roles/openvswitch/handlers/main.yml @@ -22,7 +22,6 @@ or openvswitch_start_ovsdb_server | changed notify: - Waiting for openvswitch_db service to be ready - - Ensuring OVS bridge is properly setup - name: Waiting for openvswitch_db service to be ready command: docker exec openvswitch_db ovs-vsctl --no-wait show @@ -32,18 +31,6 @@ retries: 30 delay: 2 -- name: Ensuring OVS bridge is properly setup - command: docker exec openvswitch_db /usr/local/bin/kolla_ensure_openvswitch_configured {{ item.0 }} {{ item.1 }} - register: status - changed_when: status.stdout.find('changed') != -1 - when: - - inventory_hostname in groups["network"] - or (inventory_hostname in groups["compute"] and computes_need_external_bridge | bool ) - - not enable_onos | bool - with_together: - - "{{ neutron_bridge_name.split(',') }}" - - "{{ neutron_external_interface.split(',') }}" - - name: Restart openvswitch-vswitchd container vars: service_name: "openvswitch-vswitchd" diff --git a/ansible/roles/openvswitch/tasks/deploy.yml b/ansible/roles/openvswitch/tasks/deploy.yml index ad915af159..110210a16b 100644 --- a/ansible/roles/openvswitch/tasks/deploy.yml +++ b/ansible/roles/openvswitch/tasks/deploy.yml @@ -3,3 +3,5 @@ - name: Flush Handlers meta: flush_handlers + +- include_tasks: ensure-ovs-bridge.yml diff --git a/ansible/roles/openvswitch/tasks/ensure-ovs-bridge.yml b/ansible/roles/openvswitch/tasks/ensure-ovs-bridge.yml new file mode 100644 index 0000000000..818a1e487e --- /dev/null +++ b/ansible/roles/openvswitch/tasks/ensure-ovs-bridge.yml @@ -0,0 +1,12 @@ +--- +- name: Ensuring OVS bridge is properly setup + command: docker exec openvswitch_db /usr/local/bin/kolla_ensure_openvswitch_configured {{ item.0 }} {{ item.1 }} + register: status + changed_when: status.stdout.find('changed') != -1 + when: + - inventory_hostname in groups["network"] + or (inventory_hostname in groups["compute"] and computes_need_external_bridge | bool ) + - not enable_onos | bool + with_together: + - "{{ neutron_bridge_name.split(',') }}" + - "{{ neutron_external_interface.split(',') }}" diff --git a/ansible/roles/openvswitch/tasks/upgrade.yml b/ansible/roles/openvswitch/tasks/upgrade.yml index ad915af159..110210a16b 100644 --- a/ansible/roles/openvswitch/tasks/upgrade.yml +++ b/ansible/roles/openvswitch/tasks/upgrade.yml @@ -3,3 +3,5 @@ - name: Flush Handlers meta: flush_handlers + +- include_tasks: ensure-ovs-bridge.yml