tasks: Ensure Open vSwitch is started for all providers that need it

Previously, openvswitch was only started when we were using the ODL
provider but we should start it for all providers that need it. As such
we move the conditional which checks whether Open vSwitch is needed into
a new variable and we use that to start/enable the service and also to
install the package when needed.

Change-Id: I4ec4fc2c2124a941f24478cbdf39ed34c0dce56f
(cherry picked from commit 4b940c8337)
This commit is contained in:
Markos Chandras 2018-01-29 14:39:23 +00:00
parent f4ff2786c5
commit 360c9f9e60
2 changed files with 15 additions and 3 deletions

View File

@ -169,3 +169,10 @@
section: neutron
option: venv_tag
value: "{{ neutron_venv_tag }}"
- name: Ensure Open vSwitch service is started and enabled
service:
name: "{{ neutron_ovs_service_name }}"
state: started
enabled: yes
when: neutron_needs_openvswitch

View File

@ -13,6 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###
### Open vSwitch
###
neutron_needs_openvswitch: (neutron_services['neutron-openvswitch-agent']['group'] in group_names and neutron_services['neutron-openvswitch-agent'].service_en | bool)
or (neutron_services['dragonflow-controller-agent']['group'] in group_names and neutron_services['dragonflow-controller-agent'].service_en | bool)
or (neutron_services['dragonflow-l3-agent']['group'] in group_names and neutron_services['dragonflow-l3-agent'].service_en | bool)
###
### Packages
###
@ -24,9 +31,7 @@
#
neutron_package_list: |-
{% set packages = neutron_distro_packages %}
{% if (neutron_services['neutron-openvswitch-agent']['group'] in group_names and neutron_services['neutron-openvswitch-agent'].service_en | bool)
or (neutron_services['dragonflow-controller-agent']['group'] in group_names and neutron_services['dragonflow-controller-agent'].service_en | bool)
or (neutron_services['dragonflow-l3-agent']['group'] in group_names and neutron_services['dragonflow-l3-agent'].service_en | bool) %}
{% if neutron_needs_openvswitch | bool %}
{% set _ = packages.extend(neutron_ovs_distro_packages) %}
{% endif %}
{% if neutron_services['neutron-linuxbridge-agent']['group'] in group_names and neutron_services['neutron-linuxbridge-agent'].service_en | bool %}