1 Puppet::Type.newtype(:nova_network) do
3 @doc = "Manage creation/deletion of nova networks. During creation, network
4 CIDR and netmask will be calculated automatically"
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]))$/)
17 desc "The Nova network label"
18 defaultto "novanetwork"
21 newparam(:num_networks) do
22 desc 'Number of networks to create'
27 desc 'bridge to use for flat network'
31 desc 'project that the network is associated with'
40 newparam(:vlan_start) do
43 newparam(:network_size) do
48 raise(Puppet::Error, 'Label must be set') unless self[:label]