1 Puppet::Type.newtype(:neutron_port) do
3 This is currently used to model the creation of neutron ports.
5 Ports are used when associating a network and a router interface.
10 newparam(:name, :namevar => true) do
11 desc 'Symbolic name for the port'
16 desc 'The unique id of the port'
18 raise(Puppet::Error, 'This is a read only property')
22 newproperty(:admin_state_up) do
23 desc 'The administrative status of the router'
24 newvalues(/(t|T)rue/, /(f|F)alse/)
30 newproperty(:network_name) do
32 The name of the network that this port is assigned to on creation.
36 newproperty(:network_id) do
38 The uuid of the network that this port is assigned to on creation.
41 raise(Puppet::Error, 'This is a read only property')
45 newproperty(:subnet_name) do
46 desc 'A subnet to which the port is assigned on creation.'
49 newproperty(:subnet_id) do
51 The uuid of the subnet on which this ports ip exists.
54 raise(Puppet::Error, 'This is a read only property')
58 newproperty(:ip_address) do
59 desc 'A static ip address given to the port on creation.'
62 newproperty(:status) do
63 desc 'Whether the port is currently operational or not.'
65 raise(Puppet::Error, 'This is a read only property')
69 newparam(:tenant_name) do
70 desc 'The name of the tenant which will own the port.'
73 newproperty(:tenant_id) do
74 desc 'A uuid identifying the tenant which will own the port.'
77 autorequire(:service) do
81 autorequire(:keystone_tenant) do
82 [self[:tenant_name]] if self[:tenant_name]
85 autorequire(:neutron_network) do
90 if self[:tenant_id] && self[:tenant_name]
91 raise(Puppet::Error, 'Please provide a value for only one of tenant_name and tenant_id.')
93 if self[:ip_address] && self[:subnet_name]
94 raise(Puppet::Error, 'Please provide a value for only one of ip_address and subnet_name.')