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
(cherry picked from commit 8736817a98)
This commit is contained in:
David Rabel 2018-09-28 12:59:36 +02:00 committed by Pierre Riteau
parent 5224680f7a
commit da171abc26
4 changed files with 15 additions and 12 deletions

View File

@ -21,7 +21,6 @@
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,17 +31,6 @@
delay: 2
notify:
- 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 )
with_together:
- "{{ neutron_bridge_name.split(',') }}"
- "{{ neutron_external_interface.split(',') }}"
- name: Restart openvswitch-vswitchd container
vars:
service_name: "openvswitch-vswitchd"

View File

@ -6,3 +6,5 @@
- name: Flush Handlers
meta: flush_handlers
- include: ensure-ovs-bridge.yml

View File

@ -0,0 +1,11 @@
---
- 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 )
with_together:
- "{{ neutron_bridge_name.split(',') }}"
- "{{ neutron_external_interface.split(',') }}"

View File

@ -3,3 +3,5 @@
- name: Flush Handlers
meta: flush_handlers
- include: ensure-ovs-bridge.yml