diff --git a/tobiko/openstack/neutron/config.py b/tobiko/openstack/neutron/config.py index 88175cf08..24ba74568 100644 --- a/tobiko/openstack/neutron/config.py +++ b/tobiko/openstack/neutron/config.py @@ -27,12 +27,17 @@ OPTIONS = [ cfg.IntOpt('ipv4_prefixlen', default=24, help="The mask bits for IPv4 subnets"), + cfg.ListOpt('ipv4_dns_nameservers', + default=['8.8.8.8', '8.8.4.4'], + help="The CIDR block to allocate IPv4 subnets from"), cfg.StrOpt('ipv6_cidr', default='2001:db8::/48', help="The CIDR block to allocate IPv6 subnets from"), cfg.IntOpt('ipv6_prefixlen', default=64, help="The mask bits for IPv6 subnets"), + cfg.ListOpt('ipv6_dns_nameservers', + help="The CIDR block to allocate IPv4 subnets from"), cfg.IntOpt('custom_mtu_size', default=1350, help=("Customized maximum transfer unit size\n" diff --git a/tobiko/openstack/stacks/_neutron.py b/tobiko/openstack/stacks/_neutron.py index cfdc20502..28cadb58f 100644 --- a/tobiko/openstack/stacks/_neutron.py +++ b/tobiko/openstack/stacks/_neutron.py @@ -158,6 +158,10 @@ class NetworkStackFixture(heat.HeatStackFixture): def ipv4_subnet_gateway_ip(self): return netaddr.IPAddress(self.ipv4_subnet_details['gateway_ip']) + @property + def ipv4_dns_nameservers(self): + return ','.join(CONF.tobiko.neutron.ipv4_dns_nameservers or []) + @property def ipv6_subnet_details(self): return neutron.get_subnet(self.ipv6_subnet_id) @@ -170,6 +174,10 @@ class NetworkStackFixture(heat.HeatStackFixture): def ipv6_subnet_gateway_ip(self): return netaddr.IPAddress(self.ipv6_subnet_details['gateway_ip']) + @property + def ipv6_dns_nameservers(self): + return ','.join(CONF.tobiko.neutron.ipv6_dns_nameservers or []) + @property def gateway_details(self): return neutron.get_router(self.gateway_id) diff --git a/tobiko/openstack/stacks/neutron/network.yaml b/tobiko/openstack/stacks/neutron/network.yaml index 11a5ab29c..65bf23cdf 100644 --- a/tobiko/openstack/stacks/neutron/network.yaml +++ b/tobiko/openstack/stacks/neutron/network.yaml @@ -42,16 +42,12 @@ parameters: ipv4_dns_nameservers: description: IPv4 nameservers IP addresses type: comma_delimited_list - default: [] - constraints: - - custom_constraint: dns_name + default: '' ipv6_dns_nameservers: description: IPv6 nameservers IP addresses type: comma_delimited_list - default: [] - constraints: - - custom_constraint: dns_name + default: '' ipv6_address_mode: description: IPv6 address mode