]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/neutron/manifests/plugins/nvp.pp
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / neutron / manifests / plugins / nvp.pp
1 #
2 # Configure the Nicira NVP plugin for neutron.
3 #
4 # === Parameters
5 #
6 # [*nvp_controllers*]
7 #   The password for connection to VMware vCenter server.
8 #
9 # [*nvp_user*]
10 #   The user name for NVP controller.
11 #
12 # [*nvp_password*]
13 #   The password for NVP controller
14 #
15 # [*default_tz_uuid*]
16 #   UUID of the pre-existing default NVP Transport zone to be used for creating
17 #   tunneled isolated "Neutron" networks. This option MUST be specified.
18 #
19 # [*default_l3_gw_service_uuid*]
20 #   (Optional) UUID for the default l3 gateway service to use with this cluster.
21 #   To be specified if planning to use logical routers with external gateways.
22 #   Defaults to None.
23 #
24 class neutron::plugins::nvp (
25   $default_tz_uuid,
26   $nvp_controllers,
27   $nvp_user,
28   $nvp_password,
29   $default_l3_gw_service_uuid = undef,
30   $package_ensure    = 'present'
31 ) {
32
33   include neutron::params
34
35   Package['neutron'] -> Package['neutron-plugin-nvp']
36   Package['neutron-plugin-nvp'] -> Neutron_plugin_nvp<||>
37   Neutron_plugin_nvp<||> ~> Service<| title == 'neutron-server' |>
38   Package['neutron-plugin-nvp'] -> Service<| title == 'neutron-server' |>
39
40   package { 'neutron-plugin-nvp':
41     ensure  => $package_ensure,
42     name    => $::neutron::params::nvp_server_package
43   }
44
45   validate_array($nvp_controllers)
46
47   neutron_plugin_nvp {
48     'DEFAULT/default_tz_uuid': value => $default_tz_uuid;
49     'DEFAULT/nvp_controllers': value => join($nvp_controllers, ',');
50     'DEFAULT/nvp_user':        value => $nvp_user;
51     'DEFAULT/nvp_password':    value => $nvp_password, secret => true;
52     'nvp/metadata_mode':       value => 'access_network';
53   }
54
55   if($default_l3_gw_service_uuid) {
56     neutron_plugin_nvp {
57       'DEFAULT/default_l3_gw_service_uuid': value => $default_l3_gw_service_uuid;
58     }
59   }
60
61   if $::neutron::core_plugin != 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2' {
62     fail('nvp plugin should be the core_plugin in neutron.conf')
63   }
64
65   # In RH, this link is used to start Neutron process but in Debian, it's used only
66   # to manage database synchronization.
67   file {'/etc/neutron/plugin.ini':
68     ensure  => link,
69     target  => '/etc/neutron/plugins/nicira/nvp.ini',
70     require => Package['neutron-plugin-nvp']
71   }
72
73 }