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
5b6354a3
Commit
5b6354a3
authored
9 years ago
by
Alessandro Costantini
Browse files
Options
Downloads
Patches
Plain Diff
Router added for doublemetwork
parent
e992050f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!13
Network extdouble
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 @
5b6354a3
...
@@ -51,6 +51,8 @@ class iaas::profile::neutron::router (
...
@@ -51,6 +51,8 @@ class iaas::profile::neutron::router (
}
}
class
{
'::neutron::agents::l3'
:
class
{
'::neutron::agents::l3'
:
#double_external_network
# external_network_bridge => 'br-ex',
external_network_bridge
=>
' '
,
external_network_bridge
=>
' '
,
use_namespaces
=>
true
,
use_namespaces
=>
true
,
router_delete_namespaces
=>
true
,
router_delete_namespaces
=>
true
,
...
@@ -73,6 +75,8 @@ class iaas::profile::neutron::router (
...
@@ -73,6 +75,8 @@ class iaas::profile::neutron::router (
}
}
class
{
'::neutron::agents::vpnaas'
:
class
{
'::neutron::agents::vpnaas'
:
#double_external_network
# external_network_bridge => "br-ex",
external_network_bridge
=>
' '
,
external_network_bridge
=>
' '
,
}
}
class
{
'::neutron::agents::lbaas'
:
}
class
{
'::neutron::agents::lbaas'
:
}
...
@@ -110,20 +114,25 @@ class iaas::profile::neutron::router (
...
@@ -110,20 +114,25 @@ class iaas::profile::neutron::router (
local_ip
=>
$local_ip
,
local_ip
=>
$local_ip
,
enabled
=>
true
,
enabled
=>
true
,
tunnel_types
=>
[
'gre'
],
tunnel_types
=>
[
'gre'
],
#double_external_network, variable modified
#ori 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'
],
}
}
# $_external_device1 = device_for_network($external_network1)
# notify { "br-ex1: $::brex1_eval":
notify
{
"br-ex1:
$::brex1_eval
"
:
# loglevel => alert,
loglevel
=>
alert
,
# }
}
# notify { "br-ex2: $::brex2_eval":
notify
{
"br-ex2:
$::brex2_eval
"
:
# loglevel => alert,
loglevel
=>
alert
,
# }
}
# notify { "external device1: $_external_device1 -- external network: $external_network1":
# 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
{
...
@@ -151,6 +160,8 @@ class iaas::profile::neutron::router (
...
@@ -151,6 +160,8 @@ class iaas::profile::neutron::router (
}
}
# 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'
{
...
@@ -225,9 +236,11 @@ class iaas::profile::neutron::router (
...
@@ -225,9 +236,11 @@ class iaas::profile::neutron::router (
if
$external_device2
{
if
$external_device2
{
# notify { "external device2: $_external_device2 -- external network: $external_network2":
# $_external_device2 = device_for_network($external_network2)
# loglevel => alert,
#notify { "external device2: $_external_device2 -- external network: $external_network2":
# }
# loglevel => alert,
#}
# 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'
{
...
@@ -237,29 +250,73 @@ class iaas::profile::neutron::router (
...
@@ -237,29 +250,73 @@ class iaas::profile::neutron::router (
$public_netmask2
=
$::facts
[
"netmask_
${external_device2}
"
]
$public_netmask2
=
$::facts
[
"netmask_
${external_device2}
"
]
$public_macaddr2
=
$::facts
[
"macaddress_
${external_device2}
"
]
$public_macaddr2
=
$::facts
[
"macaddress_
${external_device2}
"
]
network_config
{
$external_device2
:
# if $public_ipaddress2 {
ensure
=>
'present'
,
# network_config { $external_device2:
family
=>
'inet'
,
# ensure => 'present',
method
=>
'manual'
,
# family => 'inet',
options
=>
{
# method => 'manual',
'up'
=>
"ifconfig
${external_device2}
0.0.0.0 promisc up"
,
# options => {
'down'
=>
"ifconfig
${external_device2}
promisc down"
,
# 'up' => "ifconfig ${external_device2} 0.0.0.0 promisc up",
},
# 'down' => "ifconfig ${external_device2} promisc down",
}
->
# },
vs_port
{
$external_device2
:
# } ->
ensure
=>
present
,
# network_config { 'br-ex2':
bridge
=>
'br-ex2'
,
# ensure => 'present',
require
=>
Class
[
'::neutron::agents::ml2::ovs'
],
# family => 'inet',
}
->
# method => 'static',
exec
{
"set_br-ex2_hwaddr"
:
# ipaddress => $public_ipaddress2,
command
=>
"ovs-vsctl set bridge br-ex2 other-config:hwaddr=
$public_macaddr2
"
,
# netmask => $public_netmask2,
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/"
,
}
# }
}
}
}
}
##Public/private network configuration for tenant - added
##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 @
5b6354a3
# A convenience method to set up a router between
# A convenience method to set up a router between
# a private subnet and the public network. The
# 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
# where tenant is the name of the tenant to assign
# the router to and subnet is the name of the
# the router to and subnet is the name of the
# subnet to connect the router to.
# subnet to connect the router to.
define
iaas::setup::router
{
define
iaas::setup::router
{
$valarray
=
split
(
$title
,
':'
)
$valarray
=
split
(
$title
,
':'
)
$tenant
=
$valarray
[
0
]
$tenant
=
'test'
$rname
=
$valarray
[
0
]
$subnet
=
$valarray
[
1
]
$subnet
=
$valarray
[
1
]
neutron_router
{
$tenant
:
if
$rname
==
'test1'
{
tenant_name
=>
$tenant
,
gateway_network_name
=>
'public1'
,
require
=>
[
Neutron_network
[
'public1'
],
Neutron_subnet
[
$subnet
]]
}
->
neutron_router_interface
{
$title
:
neutron_router
{
$rname
:
ensure
=>
present
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 @
5b6354a3
...
@@ -31,7 +31,7 @@ $ip_range2 = "start=${start_ip2},end=${end_ip2}"
...
@@ -31,7 +31,7 @@ $ip_range2 = "start=${start_ip2},end=${end_ip2}"
provider_physical_network
=>
'physnet1'
,
provider_physical_network
=>
'physnet1'
,
shared
=>
false
,
shared
=>
false
,
}
->
}
->
neutron_subnet
{
$external_network1
:
neutron_subnet
{
'public-sub1'
:
cidr
=>
$external_network1
,
cidr
=>
$external_network1
,
ip_version
=>
'4'
,
ip_version
=>
'4'
,
gateway_ip
=>
$gateway1
,
gateway_ip
=>
$gateway1
,
...
@@ -64,7 +64,7 @@ $ip_range2 = "start=${start_ip2},end=${end_ip2}"
...
@@ -64,7 +64,7 @@ $ip_range2 = "start=${start_ip2},end=${end_ip2}"
provider_physical_network
=>
'physnet2'
,
provider_physical_network
=>
'physnet2'
,
shared
=>
false
,
shared
=>
false
,
}
->
}
->
neutron_subnet
{
$external_network2
:
neutron_subnet
{
'public-sub2'
:
cidr
=>
$external_network2
,
cidr
=>
$external_network2
,
ip_version
=>
'4'
,
ip_version
=>
'4'
,
gateway_ip
=>
$gateway2
,
gateway_ip
=>
$gateway2
,
...
@@ -91,9 +91,9 @@ $ip_range2 = "start=${start_ip2},end=${end_ip2}"
...
@@ -91,9 +91,9 @@ $ip_range2 = "start=${start_ip2},end=${end_ip2}"
}
}
# router setup for the tenant test
# router setup for the tenant test
#
iaas::setup::router { "test:${private_network1}": }
iaas::setup::router
{
"test
1
:
${private_network1}
"
:
}
#
if $external_network2 {
if
$external_network2
{
#
iaas::setup::router { "test:${private_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