Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iaas-ha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OCP-TOOLS
iaas-ha
Commits
4bdeb9f5
Commit
4bdeb9f5
authored
9 years ago
by
Riccardo Bucchi
Browse files
Options
Downloads
Plain Diff
Merge branch 'network_extdouble' into 'master'
Network extdouble See merge request
!13
parents
e992050f
bf0c4a3b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
manifests/profile/neutron/router.pp
+88
-31
88 additions, 31 deletions
manifests/profile/neutron/router.pp
manifests/setup/router.pp
+26
-9
26 additions, 9 deletions
manifests/setup/router.pp
manifests/setup/sharednetwork.pp
+6
-6
6 additions, 6 deletions
manifests/setup/sharednetwork.pp
with
120 additions
and
46 deletions
manifests/profile/neutron/router.pp
+
88
−
31
View file @
4bdeb9f5
...
...
@@ -51,6 +51,8 @@ class iaas::profile::neutron::router (
}
class
{
'::neutron::agents::l3'
:
#double_external_network
# external_network_bridge => 'br-ex',
external_network_bridge
=>
' '
,
use_namespaces
=>
true
,
router_delete_namespaces
=>
true
,
...
...
@@ -73,6 +75,8 @@ class iaas::profile::neutron::router (
}
class
{
'::neutron::agents::vpnaas'
:
#double_external_network
# external_network_bridge => "br-ex",
external_network_bridge
=>
' '
,
}
class
{
'::neutron::agents::lbaas'
:
}
...
...
@@ -110,20 +114,25 @@ class iaas::profile::neutron::router (
local_ip
=>
$local_ip
,
enabled
=>
true
,
tunnel_types
=>
[
'gre'
],
#double_external_network, variable modified
#ori bridge_mappings => ['external:br-ex'],
# bridge_mappings => [$bridge_mappings],
bridge_mappings
=>
[
$bridge_mappings1
,
$bridge_mappings2
],
require
=>
File
[
'etc_default_neutron-server'
],
}
# $_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,
# }
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
if
$public_gateway
{
...
...
@@ -151,6 +160,8 @@ class iaas::profile::neutron::router (
}
# if $_external_device1 != 'br_ex1' {
# Evaluate br-ex1, if present set it
if
$::brex1_eval
!=
'br-ex1'
{
...
...
@@ -225,9 +236,11 @@ class iaas::profile::neutron::router (
if
$external_device2
{
# notify { "external device2: $_external_device2 -- external network: $external_network2":
# loglevel => alert,
# }
# $_external_device2 = device_for_network($external_network2)
#notify { "external device2: $_external_device2 -- external network: $external_network2":
# loglevel => alert,
#}
# if $_external_device2 != 'br_ex2' {
# Evaluate br-ex2, if presetn set it
if
$::brex2_eval
!=
'br-ex2'
{
...
...
@@ -237,29 +250,73 @@ class iaas::profile::neutron::router (
$public_netmask2
=
$::facts
[
"netmask_
${external_device2}
"
]
$public_macaddr2
=
$::facts
[
"macaddress_
${external_device2}
"
]
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/"
,
}
# if $public_ipaddress2 {
# 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",
# },
# } ->
# network_config { 'br-ex2':
# ensure => 'present',
# family => 'inet',
# method => 'static',
# ipaddress => $public_ipaddress2,
# netmask => $public_netmask2,
# } ->
# 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/"
,
}
# }
}
}
##Public/private network configuration for tenant - added
#
class { '::iaas::setup::sharednetwork': }
class
{
'::iaas::setup::sharednetwork'
:
}
}
This diff is collapsed.
Click to expand it.
manifests/setup/router.pp
+
26
−
9
View file @
4bdeb9f5
# A convenience method to set up a router between
# a private subnet and the public network. The
# $title of the resource is 'tena
nt
:subnet',
# $title of the resource is '
rou
te
r
na
me
:subnet',
# 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
=
$valarray
[
0
]
$tenant
=
'test'
$rname
=
$valarray
[
0
]
$subnet
=
$valarray
[
1
]
neutron_router
{
$tenant
:
tenant_name
=>
$tenant
,
gateway_network_name
=>
'public1'
,
require
=>
[
Neutron_network
[
'public1'
],
Neutron_subnet
[
$subnet
]]
}
->
if
$rname
==
'test1'
{
neutron_router_interface
{
$title
:
ensure
=>
present
neutron_router
{
$rname
:
tenant_name
=>
$tenant
,
gateway_network_name
=>
'public1'
,
require
=>
[
Neutron_network
[
'public1'
],
Neutron_subnet
[
$subnet
]]
}
->
neutron_router_interface
{
$title
:
ensure
=>
present
}
}
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
}
}
}
This diff is collapsed.
Click to expand it.
manifests/setup/sharednetwork.pp
+
6
−
6
View file @
4bdeb9f5
...
...
@@ -31,7 +31,7 @@ $ip_range2 = "start=${start_ip2},end=${end_ip2}"
provider_physical_network
=>
'physnet1'
,
shared
=>
false
,
}
->
neutron_subnet
{
$external_network1
:
neutron_subnet
{
"public1-
$external_network1
"
:
cidr
=>
$external_network1
,
ip_version
=>
'4'
,
gateway_ip
=>
$gateway1
,
...
...
@@ -64,7 +64,7 @@ $ip_range2 = "start=${start_ip2},end=${end_ip2}"
provider_physical_network
=>
'physnet2'
,
shared
=>
false
,
}
->
neutron_subnet
{
$external_network2
:
neutron_subnet
{
"public2-
$external_network2
"
:
cidr
=>
$external_network2
,
ip_version
=>
'4'
,
gateway_ip
=>
$gateway2
,
...
...
@@ -91,9 +91,9 @@ $ip_range2 = "start=${start_ip2},end=${end_ip2}"
}
# router setup for the tenant test
#
iaas::setup::router { "test:${private_network1}": }
#
if $external_network2 {
#
iaas::setup::router { "test:${private_network2}": }
#
}
iaas::setup::router
{
"test
1
:
${private_network1}
"
:
}
if
$external_network2
{
iaas::setup::router
{
"test
2
:
${private_network2}
"
:
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment