diff --git a/deployment/puppet/osnailyfacter/modular/virtual_ips/virtual_ips.pp b/deployment/puppet/osnailyfacter/modular/virtual_ips/virtual_ips.pp index 587623939e..08aa9060f0 100644 --- a/deployment/puppet/osnailyfacter/modular/virtual_ips/virtual_ips.pp +++ b/deployment/puppet/osnailyfacter/modular/virtual_ips/virtual_ips.pp @@ -5,6 +5,7 @@ $public_int = hiera('public_int', undef) $primary_controller_nodes = hiera('primary_controller_nodes', false) $network_scheme = hiera('network_scheme', {}) $use_neutron = hiera('use_neutron', false) +$deploy_vrouter = hiera('deploy_vrouter', true) if ( hiera('vip_management_cidr_netmask', false )){ $vip_management_cidr_netmask = hiera('vip_management_cidr_netmask') @@ -37,30 +38,38 @@ $management_vip_data = { ping_host_list => "", } -$management_vrouter_vip_data = { - namespace => 'vrouter', - nic => $internal_int, - base_veth => "${internal_int}-vrouter", - ns => 'vrouter', - ns_veth => 'vr-mgmt', - ip => hiera('management_vrouter_vip'), - cidr_netmask => $vip_management_cidr_netmask, - gateway => 'none', - gateway_metric => '0', - bridge => $network_scheme['roles']['management'], - tie_with_ping => false, - ping_host_list => "", -} - cluster::virtual_ip { 'management' : vip => $management_vip_data, } -cluster::virtual_ip { 'management_vrouter' : - vip => $management_vrouter_vip_data, + +if $deploy_vrouter { + $management_vrouter_vip_data = { + namespace => 'vrouter', + nic => $internal_int, + base_veth => "${internal_int}-vrouter", + ns => 'vrouter', + ns_veth => 'vr-mgmt', + ip => hiera('management_vrouter_vip'), + cidr_netmask => $vip_management_cidr_netmask, + gateway => 'none', + gateway_metric => '0', + bridge => $network_scheme['roles']['management'], + tie_with_ping => false, + ping_host_list => "", + } + + cluster::virtual_ip { 'management_vrouter' : + vip => $management_vrouter_vip_data, + } + + $management_vips = ['management', 'management_vrouter'] +} else { + $management_vips = ['management'] } -$management_vips = ['management', 'management_vrouter'] + + if $public_int { # todo:(sv): temporary commented. Will be uncommented while 'multiple-l2-network' feature re-implemented @@ -81,31 +90,38 @@ if $public_int { other_networks => $vip_publ_other_nets, } - $public_vrouter_vip_data = { - namespace => 'vrouter', - nic => $public_int, - base_veth => "${public_int}-vrouter", - ns_veth => 'vr-ex', - ns => 'vrouter', - ip => hiera('public_vrouter_vip'), - cidr_netmask => $vip_public_cidr_netmask, - gateway => $network_scheme['endpoints']['br-ex']['gateway'], - gateway_metric => '0', - bridge => $network_scheme['roles']['ex'], - ns_iptables_start_rules => "iptables -t nat -A POSTROUTING -o vr-ex -j MASQUERADE", - ns_iptables_stop_rules => "iptables -t nat -D POSTROUTING -o vr-ex -j MASQUERADE", - collocation => 'management_vrouter', - } - cluster::virtual_ip { 'public' : vip => $public_vip_data, } - cluster::virtual_ip { 'public_vrouter' : - vip => $public_vrouter_vip_data, + + if $deploy_vrouter { + $public_vrouter_vip_data = { + namespace => 'vrouter', + nic => $public_int, + base_veth => "${public_int}-vrouter", + ns_veth => 'vr-ex', + ns => 'vrouter', + ip => hiera('public_vrouter_vip'), + cidr_netmask => $vip_public_cidr_netmask, + gateway => $network_scheme['endpoints']['br-ex']['gateway'], + gateway_metric => '0', + bridge => $network_scheme['roles']['ex'], + ns_iptables_start_rules => "iptables -t nat -A POSTROUTING -o vr-ex -j MASQUERADE", + ns_iptables_stop_rules => "iptables -t nat -D POSTROUTING -o vr-ex -j MASQUERADE", + collocation => 'management_vrouter', + } + + cluster::virtual_ip { 'public_vrouter' : + vip => $public_vrouter_vip_data, + } + + $public_vips = ['public_vip', 'public_vrouter'] + } else { + $public_vips = ['public_vip'] } - $public_vips = ['public_vip', 'public_vrouter'] + $vips = concat($management_vips, $public_vips) } else { $vips = $management_vips