try again, with puppetforge modules, correctly included now
[mirror/dsa-puppet.git] / 3rdparty / modules / nova / manifests / network / vlan.pp
1 # == Class: nova::network::vlan
2 #
3 # Configures nova network to use vlans
4 #
5 # === Parameters:
6 #
7 # [*fixed_range*]
8 #   (required) IPv4 CIDR of the network
9 #
10 # [*vlan_interface*]
11 #   (required) Physical ethernet adapter name for vlan networking
12 #
13 # [*public_interface*]
14 #   (optional) Interface for public traffic
15 #   Defaults to undef
16 #
17 # [*vlan_start*]
18 #   (optional) First vlan to use
19 #   Defaults to '300'
20 #
21 # [*force_dhcp_release*]
22 #   (optional) Whether to send a dhcp release on instance termination
23 #   Defaults to true
24 #
25 # [*dhcp_domain*]
26 #   (optional) Domain to use for building the hostnames
27 #   Defaults to 'novalocal'
28 #
29 # [*dhcpbridge*]
30 #   (optional) location of nova-dhcpbridge
31 #   Defaults to '/usr/bin/nova-dhcpbridge'
32 #
33 # [*dhcpbridge_flagfile*]
34 #   (optional) location of flagfiles for dhcpbridge
35 #   Defaults to '/etc/nova/nova.conf'
36 #
37 class nova::network::vlan (
38   $fixed_range,
39   $vlan_interface,
40   $public_interface    = undef,
41   $vlan_start          = '300',
42   $force_dhcp_release  = true,
43   $dhcp_domain         = 'novalocal',
44   $dhcpbridge          = '/usr/bin/nova-dhcpbridge',
45   $dhcpbridge_flagfile = '/etc/nova/nova.conf'
46 ) {
47
48   if $::osfamily == 'RedHat' and $::operatingsystem != 'Fedora' {
49     package { 'dnsmasq-utils': ensure => present }
50   }
51
52   if $public_interface {
53     nova_config { 'DEFAULT/public_interface': value => $public_interface }
54   }
55
56   nova_config {
57     'DEFAULT/network_manager':     value => 'nova.network.manager.VlanManager';
58     'DEFAULT/fixed_range':         value => $fixed_range;
59     'DEFAULT/vlan_interface':      value => $vlan_interface;
60     'DEFAULT/vlan_start':          value => $vlan_start;
61     'DEFAULT/force_dhcp_release':  value => $force_dhcp_release;
62     'DEFAULT/dhcp_domain':         value => $dhcp_domain;
63     'DEFAULT/dhcpbridge':          value => $dhcpbridge;
64     'DEFAULT/dhcpbridge_flagfile': value => $dhcpbridge_flagfile;
65   }
66
67 }