]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/neutron/manifests/plugins/linuxbridge.pp
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / neutron / manifests / plugins / linuxbridge.pp
1 # == Class: neutron::plugins::linuxbridge
2 #
3 # Setups linuxbridge plugin for neutron server.
4 #
5 # === Parameters
6 #
7 # [*sql_connection*]
8 #   sql_connection is no longer configured in the plugin.ini.
9 #   Use $connection in the nuetron::server class to configure the SQL
10 #   connection string.
11 #
12 # [*network_vlan_ranges*]
13 #   (required) Comma-separated list of <physical_network>[:<vlan_min>:<vlan_max>]
14 #   tuples enumerating ranges of VLAN IDs on named physical networks that are
15 #   available for allocation.
16 #
17 # [*tenant_network_type*]
18 #   (optional) Type of network to allocate for tenant networks.
19 #   Defaults to 'vlan'.
20 #
21 # [*package_ensure*]
22 #   (optional) Ensure state for package. Defaults to 'present'.
23 #
24 class neutron::plugins::linuxbridge (
25   $sql_connection      = false,
26   $network_vlan_ranges = 'physnet1:1000:2000',
27   $tenant_network_type = 'vlan',
28   $package_ensure      = 'present'
29 ) {
30
31   include neutron::params
32
33   Package['neutron'] -> Package['neutron-plugin-linuxbridge']
34   Package['neutron-plugin-linuxbridge'] -> Neutron_plugin_linuxbridge<||>
35   Neutron_plugin_linuxbridge<||> ~> Service<| title == 'neutron-server' |>
36   Package['neutron-plugin-linuxbridge'] -> Service<| title == 'neutron-server' |>
37
38   if $::operatingsystem == 'Ubuntu' {
39     file_line { '/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG':
40       path    => '/etc/default/neutron-server',
41       match   => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
42       line    => "NEUTRON_PLUGIN_CONFIG=${::neutron::params::linuxbridge_config_file}",
43       require => [
44         Package['neutron-plugin-linuxbridge'],
45         Package['neutron-server'],
46       ],
47       notify  => Service['neutron-server'],
48     }
49   }
50
51   package { 'neutron-plugin-linuxbridge':
52     ensure => $package_ensure,
53     name   => $::neutron::params::linuxbridge_server_package,
54   }
55
56   if $sql_connection {
57     warning('sql_connection is deprecated for connection in the neutron::server class')
58   }
59
60   neutron_plugin_linuxbridge {
61     'VLANS/tenant_network_type': value => $tenant_network_type;
62     'VLANS/network_vlan_ranges': value => $network_vlan_ranges;
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/linuxbridge/linuxbridge_conf.ini',
70     require => Package['neutron-plugin-linuxbridge']
71   }
72
73 }