diff --git a/manifests/network/controller.pp b/manifests/network/controller.pp index def77b9d..092b960c 100644 --- a/manifests/network/controller.pp +++ b/manifests/network/controller.pp @@ -150,6 +150,12 @@ # List of colon-separated id ranges # Defautls to ['1:10000'] # +# [*mechanism_drivers*] +# (optional) Neutron mechanism drivers to run +# List of drivers. +# Note: if l3-ha is True, do not include l2population (not compatible in Juno). +# Defaults to ['linuxbridge', 'openvswitch','l2population'] +# class cloud::network::controller( $neutron_db_host = '127.0.0.1', $neutron_db_user = 'neutron', @@ -174,6 +180,7 @@ class cloud::network::controller( $type_drivers = ['gre', 'vlan', 'flat'], $provider_vlan_ranges = ['physnet1:1000:2999'], $plugin = 'ml2', + $mechanism_drivers = ['linuxbridge', 'openvswitch','l2population'], $l3_ha = false, $router_distributed = false, # only needed by cisco n1kv plugin @@ -194,6 +201,11 @@ class cloud::network::controller( fail 'l3_ha and router_distributed are mutually exclusive, only one of them can be set to true' } + validate_array($mechanism_drivers) + if $l3_ha and member($mechanism_drivers, 'l2population') { + fail 'l3_ha does not work with l2population mechanism driver in Juno.' + } + class { 'neutron::server': auth_password => $ks_neutron_password, auth_host => $ks_keystone_admin_host, @@ -217,7 +229,7 @@ class cloud::network::controller( tunnel_id_ranges => $tunnel_id_ranges, vni_ranges => $vni_ranges, flat_networks => $flat_networks, - mechanism_drivers => ['linuxbridge', 'openvswitch','l2population'], + mechanism_drivers => $mechanism_drivers, enable_security_group => true } } diff --git a/spec/classes/cloud_network_controller_spec.rb b/spec/classes/cloud_network_controller_spec.rb index 741a319c..bc7f0b50 100644 --- a/spec/classes/cloud_network_controller_spec.rb +++ b/spec/classes/cloud_network_controller_spec.rb @@ -174,7 +174,8 @@ describe 'cloud::network::controller' do context 'with L3 HA' do before :each do - params.merge!(:l3_ha => true) + params.merge!(:l3_ha => true, + :mechanism_drivers => ['openvswitch']) end it 'should configure L3 HA' do is_expected.to contain_class('neutron::server').with( @@ -217,6 +218,14 @@ describe 'cloud::network::controller' do end it_raises 'a Puppet::Error', /l3_ha and router_distributed are mutually exclusive, only one of them can be set to true/ end + + context 'with L3 HA and l2population enabled' do + before :each do + params.merge!(:l3_ha => true, + :mechanism_drivers => ['openvswitch', 'l2population']) + end + it_raises 'a Puppet::Error', /l3_ha does not work with l2population mechanism driver in Juno./ + end end context 'on Debian platforms' do