Specify dns_domain in dhcp_agent.ini from neutron-api

Specify the dns_domain value in dhcp_agent.ini configuration
file in order to indicate the dns search domain which should
be advertised by the dnsmasq DHCP server.

Change-Id: Ic8d30fb087cce8d82960f616460d832740a00ec9
Implements: blueprint internal-dns
This commit is contained in:
Billy Olsen 2017-04-26 15:39:43 -07:00
parent d6165b16d5
commit c14ab76a43
4 changed files with 19 additions and 2 deletions

View File

@ -1393,6 +1393,10 @@ class NeutronAPIContext(OSContextGenerator):
'rel_key': 'enable-l3ha',
'default': False,
},
'dns_domain': {
'rel_key': 'dns-domain',
'default': None,
},
}
ctxt = self.get_neutron_options({})
for rid in relation_ids('neutron-plugin-api'):

View File

@ -91,6 +91,7 @@ class NeutronGatewayContext(NeutronAPIContext):
'l2_population': api_settings['l2_population'],
'enable_dvr': api_settings['enable_dvr'],
'enable_l3ha': api_settings['enable_l3ha'],
'dns_domain': api_settings['dns_domain'],
'overlay_network_type':
api_settings['overlay_network_type'],
'enable_metadata_network': config('enable-metadata-network'),

View File

@ -12,6 +12,14 @@ root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
dnsmasq_config_file = /etc/neutron/dnsmasq.conf
{% endif -%}
{% if dns_domain -%}
dns_domain = {{ dns_domain }}
# Per LP#1583769, dhcp_domain needs to be configured as well. Additional
# testing shows that this has not been changed in newton, so will also
# specify the dhcp_domain field.
dhcp_domain = {{ dns_domain }}
{% endif -%}
enable_metadata_network = {{ enable_metadata_network }}
enable_isolated_metadata = {{ enable_isolated_metadata }}

View File

@ -131,7 +131,8 @@ class TestNeutronGatewayContext(CharmTestCase):
'enable-dvr': 'True',
'overlay-network-type': 'gre',
'enable-l3ha': 'True',
'network-device-mtu': 9000}
'network-device-mtu': 9000,
'dns-domain': 'openstack.example.'}
self.test_config.set('plugin', 'ovs')
self.test_config.set('debug', False)
self.test_config.set('verbose', True)
@ -153,6 +154,7 @@ class TestNeutronGatewayContext(CharmTestCase):
'shared_secret': 'testsecret',
'enable_dvr': True,
'enable_l3ha': True,
'dns_domain': 'openstack.example.',
'local_ip': '10.5.0.1',
'instance_mtu': 1420,
'core_plugin': "ml2",
@ -183,7 +185,8 @@ class TestNeutronGatewayContext(CharmTestCase):
'enable-dvr': 'True',
'overlay-network-type': 'gre',
'enable-l3ha': 'True',
'network-device-mtu': 9000}
'network-device-mtu': 9000,
'dns-domain': 'openstack.example.'}
self.test_config.set('plugin', 'ovs')
self.test_config.set('debug', False)
self.test_config.set('verbose', True)
@ -205,6 +208,7 @@ class TestNeutronGatewayContext(CharmTestCase):
'shared_secret': 'testsecret',
'enable_dvr': True,
'enable_l3ha': True,
'dns_domain': 'openstack.example.',
'local_ip': '192.168.20.2',
'instance_mtu': 1420,
'core_plugin': "ml2",