Optional gateways

This commit is contained in:
vic 2013-03-14 17:39:42 +04:00 committed by Gerrit Code Review
parent a463179209
commit f5888ecdb6
9 changed files with 62 additions and 42 deletions

View File

@ -177,8 +177,12 @@ class ConfigYaml
self.mandatory('swift')
end
def default_gateway()
self.mandatory('default_gateway')
def default_gateway_internal()
self.obligatory('default_gateway_internal')
end
def default_gateway_public()
self.obligatory('default_gateway_public')
end
def nagios_master()
@ -238,7 +242,8 @@ class Manifest
:external_ipinfo => config.external_ip_info(),
:nodes => config.nodes(),
:dns_nameservers => config.dns_nameservers(),
:default_gateway => config.default_gateway(),
:default_gateway_internal => config.default_gateway_internal(),
:default_gateway_public => config.default_gateway_public(),
:segment_range => config.segment_range()
)

View File

@ -27,7 +27,8 @@ common:
internal_interface: eth0
public_interface: eth1
private_interface: eth2
default_gateway: 10.0.1.100
default_gateway_internal: 10.0.0.100
default_gateway_public:
nagios_master: fuel-controller-01.your-domain-name.com
loopback: loopback
cinder: true
@ -97,6 +98,7 @@ common:
# for Centos
name-servers: "10.0.0.100"
name-servers-search: "your-domain-name.com"
gateway: 10.0.0.100
ksmeta: "puppet_version=2.7.19-1.el6 \
puppet_auto_setup=1 \
puppet_master=fuel-pm.your-domain-name.com \

View File

@ -65,7 +65,8 @@ $nodes_harr = [
},
]
$nodes = $nodes_harr
$default_gateway = '10.0.204.1'
$default_gateway_public = '10.0.204.1'
$default_gateway_internal = undef
# Specify nameservers here.
# Need points to cobbler node IP, or to special prepared nameservers if you known what you do.
@ -115,37 +116,37 @@ class node_netconfig (
$save_default_gateway=false,
$quantum = $quantum,
) {
if $quantum {
if $quantum {
l23network::l3::create_br_iface {'mgmt':
interface => $internal_int,
interface => $internal_interface, # !!! NO $internal_int /sv !!!
bridge => $internal_br,
ipaddr => $mgmt_ipaddr,
netmask => $mgmt_netmask,
dns_nameservers => $dns_nameservers,
save_default_gateway => $save_default_gateway,
}
gateway => $default_gateway_internal,
} ->
l23network::l3::create_br_iface {'ex':
interface => $public_int,
interface => $public_interface, # !! NO $public_int /sv !!!
bridge => $public_br,
ipaddr => $public_ipaddr,
netmask => $public_netmask,
gateway => $default_gateway,
gateway => $default_gateway_public,
}
L23network::L3::Create_br_iface['mgmt'] -> L23network::L3::Create_br_iface['ex']
} else {
# nova-network mode
l23network::l3::ifconfig {$public_int:
ipaddr => $public_ipaddr,
netmask => $public_netmask,
gateway => $default_gateway,
gateway => $default_gateway_public,
}
l23network::l3::ifconfig {$internal_int:
l23network::l3::ifconfig {$internal_int:
ipaddr => $mgmt_ipaddr,
netmask => $mgmt_netmask,
dns_nameservers => $dns_nameservers,
gateway => $default_gateway_internal,
}
}
l23network::l3::ifconfig {$private_interface: ipaddr=>'none' }
}
# Set hostname for master controller of HA cluster.

View File

@ -72,7 +72,8 @@ $nodes_harr = [
]
$nodes = $nodes_harr
$default_gateway = '10.0.204.1'
$default_gateway_public = '10.0.204.1'
$default_gateway_internal = undef
# Specify nameservers here.
# Need points to cobbler node IP, or to special prepared nameservers if you known what you do.
@ -241,25 +242,27 @@ class node_netconfig (
netmask => $mgmt_netmask,
dns_nameservers => $dns_nameservers,
save_default_gateway => $save_default_gateway,
gateway => $default_gateway_internal,
} ->
l23network::l3::create_br_iface {'ex':
interface => $public_interface, # !! NO $public_int /sv !!!
bridge => $public_br,
ipaddr => $public_ipaddr,
netmask => $public_netmask,
gateway => $default_gateway,
gateway => $default_gateway_public,
}
} else {
# nova-network mode
l23network::l3::ifconfig {$public_int:
ipaddr => $public_ipaddr,
netmask => $public_netmask,
gateway => $default_gateway,
gateway => $default_gateway_public,
}
l23network::l3::ifconfig {$internal_int:
ipaddr => $mgmt_ipaddr,
netmask => $mgmt_netmask,
dns_nameservers => $dns_nameservers,
gateway => $default_gateway_internal,
}
}
l23network::l3::ifconfig {$private_interface: ipaddr=>'none' }
@ -673,13 +676,13 @@ node /fuel-compute-[\d+]/ {
## Uncomment lines bellow if You want
## configure network of this nodes
## by puppet.
#class {'::node_netconfig':
# mgmt_ipaddr => $::internal_address,
# mgmt_netmask => $::internal_netmask,
# public_ipaddr => $::public_address,
# public_netmask => $::public_netmask,
# stage => 'netconfig',
#}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
public_ipaddr => $::public_address,
public_netmask => $::public_netmask,
stage => 'netconfig',
}
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'

View File

@ -102,7 +102,8 @@ $nodes_harr = [
]
$nodes = $nodes_harr
$default_gateway = '10.0.204.1'
$default_gateway_public = '10.0.204.1'
$default_gateway_internal = undef
# Specify nameservers here.
# Need points to cobbler node IP, or to special prepared nameservers if you known what you do.
@ -271,25 +272,27 @@ class node_netconfig (
netmask => $mgmt_netmask,
dns_nameservers => $dns_nameservers,
save_default_gateway => $save_default_gateway,
gateway => $default_gateway_internal,
} ->
l23network::l3::create_br_iface {'ex':
interface => $public_interface, # !! NO $public_int /sv !!!
bridge => $public_br,
ipaddr => $public_ipaddr,
netmask => $public_netmask,
gateway => $default_gateway,
gateway => $default_gateway_public,
}
} else {
# nova-network mode
l23network::l3::ifconfig {$public_int:
ipaddr => $public_ipaddr,
netmask => $public_netmask,
gateway => $default_gateway,
gateway => $default_gateway_public,
}
l23network::l3::ifconfig {$internal_int:
ipaddr => $mgmt_ipaddr,
netmask => $mgmt_netmask,
dns_nameservers => $dns_nameservers,
gateway => $default_gateway_internal,
}
}
l23network::l3::ifconfig {$private_interface: ipaddr=>'none' }

View File

@ -76,7 +76,8 @@ $nodes_harr = [
'public_address' => '10.0.204.108',
},]
$nodes = $nodes_harr
$default_gateway = '10.0.204.1'
$default_gateway_public = '10.0.204.1'
$default_gateway_internal = undef
# Specify nameservers here.
# Need points to cobbler node IP, or to special prepared nameservers if you known what you do.
@ -250,25 +251,27 @@ class node_netconfig (
netmask => $mgmt_netmask,
dns_nameservers => $dns_nameservers,
save_default_gateway => $save_default_gateway,
gateway => $default_gateway_internal,
} ->
l23network::l3::create_br_iface {'ex':
interface => $public_interface, # !! NO $public_int /sv !!!
bridge => $public_br,
ipaddr => $public_ipaddr,
netmask => $public_netmask,
gateway => $default_gateway,
gateway => $default_gateway_public,
}
} else {
# nova-network mode
l23network::l3::ifconfig {$public_int:
ipaddr => $public_ipaddr,
netmask => $public_netmask,
gateway => $default_gateway,
gateway => $default_gateway_public,
}
l23network::l3::ifconfig {$internal_int:
ipaddr => $mgmt_ipaddr,
netmask => $mgmt_netmask,
dns_nameservers => $dns_nameservers,
gateway => $default_gateway_internal,
}
}
l23network::l3::ifconfig {$private_interface: ipaddr=>'none' }

View File

@ -52,7 +52,8 @@ $nodes_harr = [
},
]
$nodes = $nodes_harr
$default_gateway = '10.0.204.1'
$default_gateway_public = '10.0.204.1'
$default_gateway_internal = undef
# Specify nameservers here.
# Need points to cobbler node IP, or to special prepared nameservers if you known what you do.
@ -197,33 +198,35 @@ class node_netconfig (
$save_default_gateway=false,
$quantum = $quantum,
) {
if $quantum {
if $quantum {
l23network::l3::create_br_iface {'mgmt':
interface => $internal_interface, # !!! NO $internal_int !!!
interface => $internal_interface, # !!! NO $internal_int /sv !!!
bridge => $internal_br,
ipaddr => $mgmt_ipaddr,
netmask => $mgmt_netmask,
dns_nameservers => $dns_nameservers,
save_default_gateway => $save_default_gateway,
} ->
gateway => $default_gateway_internal,
} ->
l23network::l3::create_br_iface {'ex':
interface => $public_interface, # !! NO $public_int !!!
interface => $public_interface, # !! NO $public_int /sv !!!
bridge => $public_br,
ipaddr => $public_ipaddr,
netmask => $public_netmask,
gateway => $default_gateway,
gateway => $default_gateway_public,
}
} else {
# nova-network mode
l23network::l3::ifconfig {$public_int:
ipaddr => $public_ipaddr,
netmask => $public_netmask,
gateway => $default_gateway,
gateway => $default_gateway_public,
}
l23network::l3::ifconfig {$internal_int:
l23network::l3::ifconfig {$internal_int:
ipaddr => $mgmt_ipaddr,
netmask => $mgmt_netmask,
dns_nameservers => $dns_nameservers,
gateway => $default_gateway_internal,
}
}
l23network::l3::ifconfig {$private_interface: ipaddr=>'none' }

View File

@ -42,7 +42,7 @@ class NovaSubClassesTestCase(CobblerTestCase):
def test_deploy_nova_rabbitmq(self):
self.validate(
[self.nodes().controllers[0], self.nodes().controllers[1]],
'puppet agent --test --tagsopenstack::mirantis_repos,%s' % "nova::rabbitmq")
'puppet agent --test --tags openstack::mirantis_repos,%s' % "nova::rabbitmq")
def test_deploy_nova_utilities(self):
self.validate(

View File

@ -224,7 +224,7 @@ class Manifest(object):
nodes=self.generate_nodes_configs_list(ci),
dns_nameservers=self.generate_dns_nameservers_list(ci),
ntp_servers=['pool.ntp.org',ci.internal_router()],
default_gateway=ci.public_router(),
default_gateway_public=ci.public_router(),
enable_test_repo=TEST_REPO,
deployment_id = self.deployment_id(ci),
use_syslog=use_syslog,
@ -280,7 +280,7 @@ class Manifest(object):
external_ipinfo=self.external_ip_info(ci, quantums),
nodes=self.generate_nodes_configs_list(ci),
dns_nameservers=self.generate_dns_nameservers_list(ci),
default_gateway=ci.public_router(),
default_gateway_public=ci.public_router(),
ntp_servers=['pool.ntp.org',ci.internal_router()],
enable_test_repo=TEST_REPO,
deployment_id = self.deployment_id(ci),
@ -316,7 +316,7 @@ class Manifest(object):
external_ipinfo=self.external_ip_info(ci, quantums),
nodes=self.generate_nodes_configs_list(ci),
dns_nameservers=self.generate_dns_nameservers_list(ci),
default_gateway=ci.public_router(),
default_gateway_public=ci.public_router(),
enable_test_repo=TEST_REPO,
deployment_id = self.deployment_id(ci),
)