]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/nova/lib/puppet/type/nova_network.rb
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / nova / lib / puppet / type / nova_network.rb
1 Puppet::Type.newtype(:nova_network) do
2
3   @doc = "Manage creation/deletion of nova networks.  During creation, network
4           CIDR and netmask will be calculated automatically"
5
6   ensurable
7
8   # there are concerns about determining uniqiueness of network
9   # segments b/c it is actually the combination of network/prefix
10   # that determine uniqueness
11   newparam(:network, :namevar => true) do
12     desc "IPv4 Network (ie, 192.168.1.0/24)"
13     newvalues(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(\d|[1-2]\d|3[0-2]))$/)
14   end
15
16   newparam(:label) do
17     desc "The Nova network label"
18     defaultto "novanetwork"
19   end
20
21   newparam(:num_networks) do
22     desc 'Number of networks to create'
23     defaultto(1)
24   end
25
26   newparam(:bridge) do
27     desc 'bridge to use for flat network'
28   end
29
30   newparam(:project) do
31     desc 'project that the network is associated with'
32   end
33
34   newparam(:gateway) do
35   end
36
37   newparam(:dns2) do
38   end
39
40   newparam(:vlan_start) do
41   end
42
43   newparam(:network_size) do
44     defaultto('256')
45   end
46
47   validate do
48     raise(Puppet::Error, 'Label must be set') unless self[:label]
49   end
50
51 end