Replace netmask in tests and provisioning

This commit is contained in:
vic 2013-03-19 13:58:41 +04:00 committed by Vladimir Kuklin
parent 487ae0006d
commit 78072d659b
4 changed files with 22 additions and 1 deletions

View File

@ -150,6 +150,14 @@ class ConfigYaml
self.mandatory('mirror_type')
end
def public_netmask()
self.mandatory('public_netmask')
end
def internal_netmask()
self.mandatory('internal_netmask')
end
def template()
self.obligatory('template')
end
@ -269,7 +277,9 @@ class Manifest
:dns_nameservers => config.dns_nameservers(),
:default_gateway => config.default_gateway(),
:segment_range => config.segment_range(),
:repo_proxy => config.repo_proxy()
:repo_proxy => config.repo_proxy(),
:public_netmask => config.public_netmask(),
:internal_netmask => config.internal_netmask(),
)
if config.swift()

View File

@ -28,6 +28,8 @@ common:
internal_interface: eth0
public_interface: eth1
private_interface: eth2
public_netmask: 255.255.255.0
internal_netmask: 255.255.255.0
default_gateway: 10.0.1.100
nagios_master: fuel-controller-01.your-domain-name.com
loopback: loopback

View File

@ -165,5 +165,8 @@ class CiBase(object):
def internal_net_mask(self):
return str(IPNetwork(self.environment().network_by_name('internal').ip_network).netmask)
def public_net_mask(self):
return str(IPNetwork(self.environment().network_by_name('public').ip_network).netmask)
def public_network(self):
return str(IPNetwork(self.environment().network_by_name('public').ip_network))

View File

@ -218,6 +218,8 @@ class Manifest(object):
enable_test_repo=TEST_REPO,
deployment_id = self.deployment_id(ci),
use_syslog=use_syslog,
public_netmask = ci.public_net_mask(),
internal_netmask = ci.internal_net_mask(),
)
if is_not_essex():
template.replace(
@ -274,6 +276,8 @@ class Manifest(object):
ntp_servers=['pool.ntp.org',ci.internal_router()],
enable_test_repo=TEST_REPO,
deployment_id = self.deployment_id(ci),
public_netmask = ci.public_net_mask(),
internal_netmask = ci.internal_net_mask(),
)
if is_not_essex():
template.replace(
@ -309,6 +313,8 @@ class Manifest(object):
default_gateway=ci.public_router(),
enable_test_repo=TEST_REPO,
deployment_id = self.deployment_id(ci),
public_netmask = ci.public_net_mask(),
internal_netmask = ci.internal_net_mask(),
)
if swift:
template.replace(swift_loopback=self.loopback(loopback))