1 Puppet::Type.newtype(:neutron_router) do
5 newparam(:name, :namevar => true) do
6 desc 'Symbolic name for the router'
11 desc 'The unique id of the router'
13 raise(Puppet::Error, 'This is a read only property')
17 newproperty(:admin_state_up) do
18 desc 'The administrative status of the router'
19 newvalues(/(t|T)rue/, /(f|F)alse/)
25 newproperty(:external_gateway_info) do
27 External network that this router connects to for gateway services
31 raise(Puppet::Error, 'This is a read only property')
35 newproperty(:gateway_network_name) do
37 The name of the external network that this router connects to
38 for gateway services (e.g. NAT).
42 newproperty(:gateway_network_id) do
44 The uuid of the external network that this router connects to
45 for gateway services (e.g. NAT).
48 raise(Puppet::Error, 'This is a read only property')
52 newproperty(:status) do
53 desc 'Whether the router is currently operational or not.'
55 raise(Puppet::Error, 'This is a read only property')
59 newparam(:tenant_name) do
60 desc 'The name of the tenant which will own the router.'
63 newproperty(:tenant_id) do
64 desc 'A uuid identifying the tenant which will own the router.'
67 autorequire(:service) do
71 autorequire(:keystone_tenant) do
72 [self[:tenant_name]] if self[:tenant_name]
75 autorequire(:neutron_network) do
76 [self[:gateway_network_name]] if self[:gateway_network_name]
80 if self[:ensure] != :present
83 if self[:tenant_id] && self[:tenant_name]
84 raise(Puppet::Error, <<-EOT
85 Please provide a value for only one of tenant_name and tenant_id.