diff --git a/manifests/all.pp b/manifests/all.pp index b0b9b72..7fc3d42 100644 --- a/manifests/all.pp +++ b/manifests/all.pp @@ -45,6 +45,10 @@ # [cache_server_port] local memcached instance port # [horizon] (bool) is horizon installed. Defaults to: true # [neutron] (bool) is neutron installed +# [network_vlan_ranges] array of vlan_start:vlan_stop groups +# [bridge_mappings] array of physical_newtork:l2_start:l2end groups +# [bridge_uplinks] array of bridge_name:bridge_interface groups +# [tenant_network_type] vlan, gre, etc. # The next is an array of arrays, that can be used to add call-out links to the dashboard for other apps. # There is no specific requirement for these apps to be for monitoring, that's just the defacto purpose. # Each app is defined in two parts, the display name, and the URI @@ -204,6 +208,10 @@ class openstack::all ( $neutron_auth_url = 'http://127.0.0.1:35357/v2.0', $enable_neutron_server = true, $ovs_local_ip = false, + $network_vlan_ranges = undef, + $bridge_mappings = undef, + $bridge_uplinks = undef, + $tenant_network_type = 'gre', # General $verbose = false, $enabled = true @@ -408,6 +416,18 @@ class openstack::all ( fail('bridge_interface must be set when configuring neutron') } + if ! $bridge_mappings { + $bridge_mappings_real = ["default:${external_bridge_name}"] + } else { + $bridge_mappings_real = $bridge_mappings + } + + if ! $bridge_uplinks { + $bridge_uplinks_real = ["${external_bridge_name}:${bridge_interface}"] + } else { + $bridge_uplinks_real = $bridge_uplinks + } + class { 'openstack::neutron': # Database db_host => $db_host, @@ -418,10 +438,12 @@ class openstack::all ( rabbit_virtual_host => $rabbit_virtual_host, # Neutron OVS ovs_local_ip => $ovs_local_ip_real, - bridge_uplinks => ["${external_bridge_name}:${bridge_interface}"], - bridge_mappings => ["default:${external_bridge_name}"], + bridge_uplinks => $bridge_uplinks_real, + bridge_mappings => $bridge_mappings_real, enable_ovs_agent => $enable_ovs_agent, firewall_driver => $firewall_driver, + tenant_network_type => $tenant_network_type, + network_vlan_ranges => $network_vlan_ranges, # Database db_name => $neutron_db_name, db_user => $neutron_db_user, diff --git a/spec/classes/openstack_all_spec.rb b/spec/classes/openstack_all_spec.rb index 122c222..8ac4d1d 100644 --- a/spec/classes/openstack_all_spec.rb +++ b/spec/classes/openstack_all_spec.rb @@ -125,6 +125,51 @@ describe 'openstack::all' do ) end end + + context 'with neutron_user_password, neutron_db_password, bridge_interface, ovs_local_ip, bridge_mappings, bridge_uplinks, and shared_secret set' do + before do + params.merge!( + :neutron_user_password => 'neutron_user_password', + :neutron_db_password => 'neutron_db_password', + :bridge_interface => 'eth0', + :ovs_local_ip => '10.0.1.1', + :network_vlan_ranges => '1:1000', + :bridge_mappings => ['intranet:br-intra','extranet:br-extra'], + :bridge_uplinks => ['intranet:eth1','extranet:eth2'], + :tenant_network_type => 'vlan', + :metadata_shared_secret => 'shared_md_secret' + ) + end + it 'contains an openstack::neutron class' do + should contain_class('openstack::neutron').with( + :db_host => '127.0.0.1', + :rabbit_host => '127.0.0.1', + :rabbit_user => 'openstack', + :rabbit_password => 'rabbit_pw', + :rabbit_virtual_host => '/', + :ovs_local_ip => '10.0.1.1', + :network_vlan_ranges => '1:1000', + :bridge_uplinks => ['intranet:eth1','extranet:eth2'], + :bridge_mappings => ['intranet:br-intra','extranet:br-extra'], + :tenant_network_type => 'vlan', + :enable_ovs_agent => true, + :firewall_driver => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver', + :db_name => 'neutron', + :db_user => 'neutron', + :db_password => 'neutron_db_password', + :enable_dhcp_agent => true, + :enable_l3_agent => true, + :enable_metadata_agent => true, + :auth_url => 'http://127.0.0.1:35357/v2.0', + :user_password => 'neutron_user_password', + :shared_secret => 'shared_md_secret', + :keystone_host => '127.0.0.1', + :enabled => true, + :enable_server => true, + :verbose => false + ) + end + end end context 'cinder enabled (which is the default)' do