From bb1da0074f43348f8a22e7fa4adce09978ece650 Mon Sep 17 00:00:00 2001 From: Jorge Niedbalski Date: Mon, 7 May 2018 12:18:25 -0300 Subject: [PATCH] Allow setting computes_need_external_bridge. Allow to set computes_need_external_bridge to true/false depending on the desired configuration, for allowing cases such as disable dvr and enable l3 ha. Closes-Bug: #1769686 Change-Id: I1565b08dfccb7bec2ddda8c048b7d951c9eb1824 Signed-off-by: Jorge Niedbalski --- ansible/roles/neutron/templates/ml2_conf.ini.j2 | 2 +- ansible/roles/neutron/templates/ml2_conf_xenapi.ini.j2 | 2 +- ansible/roles/openvswitch/handlers/main.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/roles/neutron/templates/ml2_conf.ini.j2 b/ansible/roles/neutron/templates/ml2_conf.ini.j2 index 0aa841ae61..83be636310 100644 --- a/ansible/roles/neutron/templates/ml2_conf.ini.j2 +++ b/ansible/roles/neutron/templates/ml2_conf.ini.j2 @@ -76,7 +76,7 @@ extensions = {{ neutron_agent_extensions|map(attribute='name')|join(',') }} {% endif %} [ovs] -{% if inventory_hostname in groups["network"] or (inventory_hostname in groups["compute"] and computes_need_external_bridge ) %} +{% if inventory_hostname in groups["network"] or (inventory_hostname in groups["compute"] and computes_need_external_bridge | bool ) %} bridge_mappings = {% for bridge in neutron_bridge_name.split(',') %}physnet{{ loop.index0 + 1 }}:{{ bridge }}{% if not loop.last %},{% endif %}{% endfor %} {% endif %} diff --git a/ansible/roles/neutron/templates/ml2_conf_xenapi.ini.j2 b/ansible/roles/neutron/templates/ml2_conf_xenapi.ini.j2 index 51ebabc60a..51e822bdbf 100644 --- a/ansible/roles/neutron/templates/ml2_conf_xenapi.ini.j2 +++ b/ansible/roles/neutron/templates/ml2_conf_xenapi.ini.j2 @@ -12,7 +12,7 @@ root_helper = [ovs] of_listen_address = {{ os_xenapi_variables.domu_himn_ip }} ovsdb_connection = tcp:{{ xenserver_himn_ip }}:{{ ovsdb_port }} -{% if computes_need_external_bridge %} +{% if computes_need_external_bridge | bool %} bridge_mappings = {% for interface in neutron_external_interface.split(',') %}physnet{{ loop.index0 + 1 }}:{{ os_xenapi_variables.domu_vifs[interface]["bridge"] }}{% if not loop.last %},{% endif %}{% endfor %} {% else %} bridge_mappings = diff --git a/ansible/roles/openvswitch/handlers/main.yml b/ansible/roles/openvswitch/handlers/main.yml index d631076ea1..0654ecd0d3 100644 --- a/ansible/roles/openvswitch/handlers/main.yml +++ b/ansible/roles/openvswitch/handlers/main.yml @@ -38,7 +38,7 @@ changed_when: status.stdout.find('changed') != -1 when: - inventory_hostname in groups["network"] - or (inventory_hostname in groups["compute"] and computes_need_external_bridge) + or (inventory_hostname in groups["compute"] and computes_need_external_bridge | bool ) with_together: - "{{ neutron_bridge_name.split(',') }}" - "{{ neutron_external_interface.split(',') }}"