Disable neutron nets provisioning
In case if some addresses needed to be excluded from floating ip range, changing floating IP pool will break further adding of compute nodes. To avoid this, we allow users to skip automatic creation of neutron networks. Change-Id: Ib830ff130d8cd9f839dd3d0e24058293db4fcf64 Signed-off-by: Illia Polliul <ipolliul@mirantis.com>
This commit is contained in:
parent
edbbde3625
commit
1c4e9b859f
|
@ -14,39 +14,43 @@
|
|||
|
||||
class contrail::provision::controller {
|
||||
|
||||
contrail::create_network{$contrail::private_net:
|
||||
netdata => $contrail::nets[$contrail::private_net],
|
||||
tenant_name => $contrail::admin_tenant,
|
||||
} ->
|
||||
if $::contrail::settings['provision_networks'] {
|
||||
|
||||
contrail::create_network{$contrail::floating_net:
|
||||
netdata => $contrail::nets[$contrail::floating_net],
|
||||
notify => Exec['prov_route_target'],
|
||||
tenant_name => $contrail::admin_tenant,
|
||||
} ->
|
||||
contrail::create_network{$contrail::private_net:
|
||||
netdata => $contrail::nets[$contrail::private_net],
|
||||
tenant_name => $contrail::admin_tenant,
|
||||
} ->
|
||||
|
||||
neutron_router { $contrail::default_router:
|
||||
ensure => 'present',
|
||||
gateway_network_name => $contrail::floating_net,
|
||||
name => $contrail::default_router,
|
||||
tenant_name => $contrail::admin_tenant,
|
||||
} ->
|
||||
contrail::create_network{$contrail::floating_net:
|
||||
netdata => $contrail::nets[$contrail::floating_net],
|
||||
notify => Exec['prov_route_target'],
|
||||
tenant_name => $contrail::admin_tenant,
|
||||
} ->
|
||||
|
||||
neutron_router_interface { "${contrail::default_router}:${contrail::private_net}__subnet":
|
||||
ensure => 'present',
|
||||
}
|
||||
neutron_router { $contrail::default_router:
|
||||
ensure => 'present',
|
||||
gateway_network_name => $contrail::floating_net,
|
||||
name => $contrail::default_router,
|
||||
tenant_name => $contrail::admin_tenant,
|
||||
} ->
|
||||
|
||||
exec { 'prov_route_target':
|
||||
provider => 'shell',
|
||||
path => '/usr/bin:/bin:/sbin',
|
||||
command => "python /usr/share/contrail-utils/add_route_target.py \
|
||||
--routing_instance_name default-domain:${contrail::admin_tenant}:${contrail::floating_net}:${contrail::floating_net} \
|
||||
--route_target_number ${contrail::route_target} --router_asn ${contrail::asnum} \
|
||||
--api_server_ip ${contrail::contrail_mgmt_vip} --api_server_port 8082 \
|
||||
--admin_user '${contrail::neutron_user}' --admin_tenant_name '${contrail::service_tenant}' --admin_password '${contrail::service_token}' \
|
||||
&& touch /etc/contrail/prov_route_target-DONE",
|
||||
creates => '/etc/contrail/prov_route_target-DONE',
|
||||
require => Contrail::Create_Network[$contrail::floating_net],
|
||||
}
|
||||
neutron_router_interface { "${contrail::default_router}:${contrail::private_net}__subnet":
|
||||
ensure => 'present',
|
||||
}
|
||||
|
||||
exec { 'prov_route_target':
|
||||
provider => 'shell',
|
||||
path => '/usr/bin:/bin:/sbin',
|
||||
command => "python /usr/share/contrail-utils/add_route_target.py \
|
||||
--routing_instance_name default-domain:${contrail::admin_tenant}:${contrail::floating_net}:${contrail::floating_net} \
|
||||
--route_target_number ${contrail::route_target} --router_asn ${contrail::asnum} \
|
||||
--api_server_ip ${contrail::contrail_mgmt_vip} --api_server_port 8082 \
|
||||
--admin_user '${contrail::neutron_user}' --admin_tenant_name '${contrail::service_tenant}' --admin_password '${contrail::service_token}' \
|
||||
&& touch /etc/contrail/prov_route_target-DONE",
|
||||
creates => '/etc/contrail/prov_route_target-DONE',
|
||||
require => Contrail::Create_Network[$contrail::floating_net],
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -168,3 +168,9 @@ attributes:
|
|||
restrictions:
|
||||
- condition: "settings:contrail.enable_tor_agents.value == false"
|
||||
action: "hide"
|
||||
provision_networks:
|
||||
value: true
|
||||
label: "Provision ostf networks"
|
||||
description: "Disable this option to disable provisioning ostf networks"
|
||||
weight: 260
|
||||
type: "checkbox"
|
Loading…
Reference in New Issue