Skip to content
Snippets Groups Projects
Commit ca7c472a authored by Alessandro Costantini's avatar Alessandro Costantini
Browse files

Comments updated

parent e0f055cf
No related branches found
No related tags found
No related merge requests found
#Multiple external networks supported
class iaas::profile::neutron::router ( class iaas::profile::neutron::router (
$public_interface = hiera('iaas::public_interface', undef), $public_interface = hiera('iaas::public_interface', undef),
$public_gateway = hiera('iaas::public_gateway', undef), $public_gateway = hiera('iaas::public_gateway', undef),
...@@ -115,25 +116,14 @@ class iaas::profile::neutron::router ( ...@@ -115,25 +116,14 @@ class iaas::profile::neutron::router (
enabled => true, enabled => true,
tunnel_types => ['gre'], tunnel_types => ['gre'],
#double_external_network, variable modified #double_external_network, variable modified
#ori bridge_mappings => ['external:br-ex'], # bridge_mappings => ['external:br-ex'],
# bridge_mappings => [$bridge_mappings],
bridge_mappings => [$bridge_mappings1,$bridge_mappings2], bridge_mappings => [$bridge_mappings1,$bridge_mappings2],
require => File['etc_default_neutron-server'], require => File['etc_default_neutron-server'],
} }
# old control statement for network bridge
# $_external_device1 = device_for_network($external_network1) # $_external_device1 = device_for_network($external_network1)
notify { "br-ex1: $::brex1_eval":
loglevel => alert,
}
notify { "br-ex2: $::brex2_eval":
loglevel => alert,
}
#notify { "external device1: $_external_device1 -- external network: $external_network1":
# loglevel => alert,
#}
# Set public network if public_interface != $external_device1 # Set public network if public_interface != $external_device1
if $public_gateway { if $public_gateway {
network_config { $public_interface: network_config { $public_interface:
...@@ -159,13 +149,13 @@ notify { "br-ex2: $::brex2_eval": ...@@ -159,13 +149,13 @@ notify { "br-ex2: $::brex2_eval":
onboot => 'true', onboot => 'true',
} }
# old control statement for network bridge
# if $_external_device1 != 'br_ex1' { # if $_external_device1 != 'br_ex1' {
# Evaluate br-ex1, if present set it # Evaluate br-ex1, if present set it
if $::brex1_eval != 'br-ex1' { if $::brex1_eval != 'br-ex1' {
## Store initial configuration from the public interface (assigned by DHCP) to restore on br-ex # Store initial configuration from the public interface (assigned by DHCP) to restore on br-ex
$public_ipaddress1 = $::facts["ipaddress_${external_device1}"] $public_ipaddress1 = $::facts["ipaddress_${external_device1}"]
$public_netmask1 = $::facts["netmask_${external_device1}"] $public_netmask1 = $::facts["netmask_${external_device1}"]
$public_macaddr1 = $::facts["macaddress_${external_device1}"] $public_macaddr1 = $::facts["macaddress_${external_device1}"]
...@@ -234,85 +224,40 @@ notify { "br-ex2: $::brex2_eval": ...@@ -234,85 +224,40 @@ notify { "br-ex2: $::brex2_eval":
} }
} }
# Configure second bridge
if $external_device2 { if $external_device2 {
# old control statement for network bridge
# $_external_device2 = device_for_network($external_network2) # $_external_device2 = device_for_network($external_network2)
#notify { "external device2: $_external_device2 -- external network: $external_network2":
# loglevel => alert,
#}
# if $_external_device2 != 'br_ex2' { # if $_external_device2 != 'br_ex2' {
# Evaluate br-ex2, if presetn set it # Evaluate br-ex2, if presetn set it
if $::brex2_eval != 'br-ex2' { if $::brex2_eval != 'br-ex2' {
## Store initial configuration from the public interface (assigned by DHCP) to restore on br-ex # Store initial configuration from the public interface (assigned by DHCP) to restore on br-ex
$public_ipaddress2 = $::facts["ipaddress_${external_device2}"] $public_ipaddress2 = $::facts["ipaddress_${external_device2}"]
$public_netmask2 = $::facts["netmask_${external_device2}"] $public_netmask2 = $::facts["netmask_${external_device2}"]
$public_macaddr2 = $::facts["macaddress_${external_device2}"] $public_macaddr2 = $::facts["macaddress_${external_device2}"]
# if $public_ipaddress2 { network_config { $external_device2:
# network_config { $external_device2: ensure => 'present',
# ensure => 'present', family => 'inet',
# family => 'inet', method => 'manual',
# method => 'manual', options => {
# options => { 'up' => "ifconfig ${external_device2} 0.0.0.0 promisc up",
# 'up' => "ifconfig ${external_device2} 0.0.0.0 promisc up", 'down' => "ifconfig ${external_device2} promisc down",
# 'down' => "ifconfig ${external_device2} promisc down", },
# }, } ->
# } -> vs_port { $external_device2:
# network_config { 'br-ex2': ensure => present,
# ensure => 'present', bridge => 'br-ex2',
# family => 'inet', require => Class['::neutron::agents::ml2::ovs'],
# method => 'static', } ->
# ipaddress => $public_ipaddress2, exec { "set_br-ex2_hwaddr":
# netmask => $public_netmask2, command => "ovs-vsctl set bridge br-ex2 other-config:hwaddr=$public_macaddr2",
# } -> path => "/usr/local/bin/:/bin/:/usr/bin:/sbin/:/usr/sbin/",
# vs_port { $external_device2: }
# ensure => present,
# bridge => 'br-ex2',
# require => Class['::neutron::agents::ml2::ovs'],
# } ->
# network_route { 'route_ext2':
# ensure => 'present',
# gateway => $external_gateway2,
# interface => 'br-ex2',
# netmask => '0.0.0.0',
# network => $external_network2,
# require => Package['ifupdown-extra']
# } ->
# exec { "set_br-ex2_hwaddr":
# command => "ovs-vsctl set bridge br-ex2 other-config:hwaddr=$public_macaddr2",
# path => "/usr/local/bin/:/bin/:/usr/bin:/sbin/:/usr/sbin/",
# } ->
# exec { "restart_external2":
# command => "ifconfig $external_device2 0.0.0.0 promisc",
# path => "/usr/local/bin/:/bin/:/sbin/:/usr/sbin/",
# } ->
# exec { "restart_br-ex2":
# command => "ifdown br-ex2 && ifup br-ex2",
# path => "/usr/local/bin/:/bin/:/sbin/:/usr/sbin/",
# }
# } else {
network_config { $external_device2:
ensure => 'present',
family => 'inet',
method => 'manual',
options => {
'up' => "ifconfig ${external_device2} 0.0.0.0 promisc up",
'down' => "ifconfig ${external_device2} promisc down",
},
} ->
vs_port { $external_device2:
ensure => present,
bridge => 'br-ex2',
require => Class['::neutron::agents::ml2::ovs'],
} ->
exec { "set_br-ex2_hwaddr":
command => "ovs-vsctl set bridge br-ex2 other-config:hwaddr=$public_macaddr2",
path => "/usr/local/bin/:/bin/:/usr/bin:/sbin/:/usr/sbin/",
}
# }
} }
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment