Newer
Older
Alessandro Costantini
committed
# A convenience method to set up a router between
# a private subnet and the public network. The
# $title of the resource is 'routername:subnet',
Alessandro Costantini
committed
# where tenant is the name of the tenant to assign
# the router to and subnet is the name of the
# subnet to connect the router to.
define iaas::setup::router {
$valarray = split($title, ':')
$tenant = 'test'
$rname = $valarray[0]
Alessandro Costantini
committed
$subnet = $valarray[1]
Alessandro Costantini
committed
neutron_router { $rname:
tenant_name => $tenant,
gateway_network_name => 'public1',
require => [Neutron_network['public1'], Neutron_subnet[$subnet]]
} ->
neutron_router_interface { $title:
ensure => present
}
Alessandro Costantini
committed
}
if $rname == 'test2' {
neutron_router { $rname:
tenant_name => $tenant,
gateway_network_name => 'public2',
require => [Neutron_network['public2'], Neutron_subnet[$subnet]]
} ->
neutron_router_interface { $title:
ensure => present
}
}