3 # Configure the cisco neutron plugin
4 # More info available here:
5 # https://wiki.openstack.org/wiki/Cisco-neutron
10 # The password that will be used to connect to the db
12 # [*keystone_password*]
13 # The password for the supplied username
16 # The name of the db table to use
20 # The user that will be used to connect to the db
24 # The address or hostname of the database
25 # Defaults to 127.0.0.1
27 # [*keystone_username*]
28 # The admin username for the plugin to use
31 # [*keystone_auth_url*]
32 # The url against which to authenticate
33 # Defaults to http://127.0.0.1:35357/v2.0/
36 # The tenant the supplied user has admin privs in
37 # Defaults to services
40 # (optional) The openvswitch plugin to use
41 # Defaults to ovs_neutron_plugin.OVSNeutronPluginV2
44 # (optional) The nexus plugin to use
45 # Defaults to undef. This will not set a nexus plugin to use
46 # Can be set to neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin
48 # Other parameters are currently not used by the plugin and
49 # can be left unchanged, but in grizzly the plugin will fail
50 # to launch if they are not there. The config for Havana will
51 # move to a single config file and this will be simplified.
53 class neutron::plugins::cisco(
58 $database_name = 'neutron',
59 $database_user = 'neutron',
60 $database_host = '127.0.0.1',
63 $keystone_username = 'neutron',
64 $keystone_tenant = 'services',
65 $keystone_auth_url = 'http://127.0.0.1:35357/v2.0/',
67 $vswitch_plugin = 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
68 $nexus_plugin = undef,
70 # Plugin minimum configuration
73 $vlan_name_prefix = 'q-',
74 $model_class = 'neutron.plugins.cisco.models.virt_phy_sw_v2.VirtualPhysicalSwitchModelV2',
76 $max_port_profiles = '65568',
77 $manager_class = 'neutron.plugins.cisco.segmentation.l2network_vlan_mgr_v2.L2NetworkVLANMgr',
78 $max_networks = '65568',
79 $package_ensure = 'present'
82 Neutron_plugin_cisco<||> ~> Service['neutron-server']
83 Neutron_plugin_cisco_db_conn<||> ~> Service['neutron-server']
84 Neutron_plugin_cisco_l2network<||> ~> Service['neutron-server']
86 ensure_resource('file', '/etc/neutron/plugins', {
93 ensure_resource('file', '/etc/neutron/plugins/cisco', {
100 # Ensure the neutron package is installed before config is set
101 # under both RHEL and Ubuntu
102 if ($::neutron::params::server_package) {
103 Package['neutron-server'] -> Neutron_plugin_cisco<||>
104 Package['neutron-server'] -> Neutron_plugin_cisco_db_conn<||>
105 Package['neutron-server'] -> Neutron_plugin_cisco_l2network<||>
107 Package['neutron'] -> Neutron_plugin_cisco<||>
108 Package['neutron'] -> Neutron_plugin_cisco_db_conn<||>
109 Package['neutron'] -> Neutron_plugin_cisco_l2network<||>
112 if $::operatingsystem == 'Ubuntu' {
113 file_line { '/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG':
114 path => '/etc/default/neutron-server',
115 match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
116 line => "NEUTRON_PLUGIN_CONFIG=${::neutron::params::cisco_config_file}",
117 require => [ Package['neutron-server'], Package['neutron-plugin-cisco'] ],
118 notify => Service['neutron-server'],
122 package { 'neutron-plugin-cisco':
123 ensure => $package_ensure,
124 name => $::neutron::params::cisco_server_package,
129 neutron_plugin_cisco {
130 'PLUGINS/nexus_plugin' : value => $nexus_plugin;
135 neutron_plugin_cisco {
136 'PLUGINS/vswitch_plugin' : value => $vswitch_plugin;
140 # neutron-server will crash if the inventory section is empty.
141 # this is usually used for specifying which physical nexus
142 # devices are to be used.
143 neutron_plugin_cisco {
144 'INVENTORY/dummy' : value => 'dummy';
147 neutron_plugin_cisco_db_conn {
148 'DATABASE/name': value => $database_name;
149 'DATABASE/user': value => $database_user;
150 'DATABASE/pass': value => $database_pass;
151 'DATABASE/host': value => $database_host;
154 neutron_plugin_cisco_l2network {
155 'VLANS/vlan_start': value => $vlan_start;
156 'VLANS/vlan_end': value => $vlan_end;
157 'VLANS/vlan_name_prefix': value => $vlan_name_prefix;
158 'MODEL/model_class': value => $model_class;
159 'PORTS/max_ports': value => $max_ports;
160 'PORTPROFILES/max_port_profiles': value => $max_port_profiles;
161 'NETWORKS/max_networks': value => $max_networks;
162 'SEGMENTATION/manager_class': value => $manager_class;
165 neutron_plugin_cisco_credentials {
166 'keystone/username': value => $keystone_username;
167 'keystone/password': value => $keystone_password, secret => true;
168 'keystone/auth_url': value => $keystone_auth_url;
169 'keystone/tenant' : value => $keystone_tenant;
172 # In RH, this link is used to start Neutron process but in Debian, it's used only
173 # to manage database synchronization.
174 if defined(File['/etc/neutron/plugin.ini']) {
175 File <| path == '/etc/neutron/plugin.ini' |> { target => '/etc/neutron/plugins/cisco/cisco_plugins.ini' }
178 file {'/etc/neutron/plugin.ini':
180 target => '/etc/neutron/plugins/cisco/cisco_plugins.ini',
181 require => Package['neutron-plugin-cisco'],