Set IPv6 params True if undercloud local_ip is IPv6

When deploying the undercloud using an IPv6 control plane
the set various parameters for IPv6 to True.

Change-Id: I101c4c70f2804779089ba25720141a9320270edc
Closes-Bug: #1831315
This commit is contained in:
Harald Jensås 2019-06-20 17:39:24 +02:00
parent 93de3b11fb
commit 5e66a91ef0
2 changed files with 47 additions and 0 deletions

View File

@ -180,6 +180,47 @@ class TestNetworkSettings(base.TestCase):
'NetworkGateway': '192.168.24.1'}}}
self.assertEqual(expected, env)
def test_ipv6_control_plane(self):
env = {}
self.conf.config(local_ip='fd12:3456:789a:1::2/64',
undercloud_admin_host='fd12:3456:789a:1::3',
undercloud_public_host='fd12:3456:789a:1::4')
self.conf.config(cidr='fd12:3456:789a:1::/64',
dhcp_start='fd12:3456:789a:1::10',
dhcp_end='fd12:3456:789a:1::20',
dhcp_exclude=[],
inspection_iprange=('fd12:3456:789a:1::30,'
'fd12:3456:789a:1::40'),
gateway='fd12:3456:789a:1::1',
masquerade=False,
host_routes=[],
group='ctlplane-subnet')
undercloud_config._process_network_args(env)
expected = {
'NovaIPv6': True,
'RabbitIPv6': True,
'MemcachedIPv6': True,
'RedisIPv6': True,
'MysqlIPv6': True,
'ControlPlaneStaticRoutes': [],
'DnsServers': '',
'IronicInspectorSubnets': [
{'gateway': 'fd12:3456:789a:1::1',
'host_routes': [],
'ip_range': 'fd12:3456:789a:1::30,fd12:3456:789a:1::40',
'netmask': 'ffff:ffff:ffff:ffff::',
'tag': 'ctlplane-subnet'}],
'MasqueradeNetworks': {},
'UndercloudCtlplaneSubnets': {
'ctlplane-subnet': {
'AllocationPools': [
{'start': 'fd12:3456:789a:1::10',
'end': 'fd12:3456:789a:1::20'}],
'HostRoutes': [],
'NetworkCidr': 'fd12:3456:789a:1::/64',
'NetworkGateway': 'fd12:3456:789a:1::1'}}}
self.assertEqual(expected, env)
def test_nameserver_toomany_fail(self):
env = {}
self.conf.config(undercloud_nameservers=['1.1.1.1', '1.1.1.2',

View File

@ -348,6 +348,12 @@ def _process_network_args(env):
'servers in undercloud_'
'nameservers.')
env['DnsServers'] = ','.join(CONF['undercloud_nameservers'])
if netaddr.IPNetwork(CONF['local_ip']).version == 6:
env['NovaIPv6'] = True
env['RabbitIPv6'] = True
env['MemcachedIPv6'] = True
env['RedisIPv6'] = True
env['MysqlIPv6'] = True
def prepare_undercloud_deploy(upgrade=False, no_validations=False,