diff --git a/defaults/main.yml b/defaults/main.yml index e0dc1498..67fdedbb 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -245,6 +245,9 @@ neutron_dhcp_config: neutron_ml2_drivers_type: "flat,vlan,vxlan,local" neutron_ml2_mechanism_drivers: "linuxbridge,l2population" +# Enable or disable L2 Population. +neutron_l2_population: "False" + ## Set this to configure overlay networks. The default is set as an empty hash. # neutron_overlay_network: # address: "172.29.241.248" @@ -257,7 +260,7 @@ neutron_overlay_network: {} ## The neutron multicast group address. This should be set as a host variable if used. ## This defaults to an empty string # neutron_vxlan_group: 239.1.1.100 -neutron_vxlan_group: "" +neutron_vxlan_group: "239.1.1.1" ## Set this variable to configure the provider networks that will be available ## When setting up networking in things like the ml2_conf.ini file. Normally diff --git a/tasks/neutron_post_install.yml b/tasks/neutron_post_install.yml index fff9c0b4..c8513e19 100644 --- a/tasks/neutron_post_install.yml +++ b/tasks/neutron_post_install.yml @@ -13,26 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Disable L2 population for L3HA support - set_fact: - neutron_l2_population: "False" - when: - - neutron_plugin_type == 'ml2' - - groups['neutron_agent'] | length >= 2 - - neutron_services['neutron-linuxbridge-agent']['service_en'] | bool - - neutron_l2_population is undefined - tags: - - neutron-config - -- name: Enable L2 population support - set_fact: - neutron_l2_population: "True" - when: - - neutron_plugin_type == 'ml2' - - neutron_l2_population is undefined - tags: - - neutron-config - - name: Copy neutron config config_template: src: "{{ item.src }}" diff --git a/templates/neutron.conf.j2 b/templates/neutron.conf.j2 index 3e1c5591..3baa115e 100644 --- a/templates/neutron.conf.j2 +++ b/templates/neutron.conf.j2 @@ -50,7 +50,7 @@ agent_down_time = {{ neutron_agent_down_time }} {% set num_agent = groups['neutron_agent'] | length %} {% if neutron_plugin_type == 'ml2' and num_agent >= 2 %} -{% if neutron_services['neutron-linuxbridge-agent']['service_en'] | bool and not neutron_l2_population | bool %} +{% if neutron_services['neutron-linuxbridge-agent']['service_en'] | bool %} {% set max_l3_router = num_agent if num_agent > 2 else 2 %} {% set min_l3_router = num_agent if (num_agent > 2 and num_agent < max_l3_router) else 2 %}