From 437b116e461396da1a7e94f1c6afde36cb380dae Mon Sep 17 00:00:00 2001 From: Juan Antonio Osorio Robles Date: Fri, 16 Jun 2017 14:10:06 +0300 Subject: [PATCH] Default neutron's dns_domain to undercloud's domain A recent commit made the parameter dns_domain in neutron.conf configurable [1]. With this parameter, we can control what domain neutron's dhcp agent gives the overcloud nodes. One can set a domain using the overcloud_domain_name parameter from undercloud.conf. With this commit, in the absence of this parameter, the domain from the undercloud host will be taken into account. If puppet cannot get this, then it will use the default from neutron.conf. [1] I61e5fc005aa27ba76f91a2b84fec751af93061b5 Change-Id: I492a781f3abe1c11344a08606d233458486a6b00 --- elements/puppet-stack-config/puppet-stack-config.pp | 6 +++++- .../puppet-stack-config/puppet-stack-config.yaml.template | 4 ++-- instack_undercloud/undercloud.py | 6 ++++-- .../Make-dns_domain-configurable-1411b51b65b83ded.yaml | 7 +++++++ 4 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/Make-dns_domain-configurable-1411b51b65b83ded.yaml diff --git a/elements/puppet-stack-config/puppet-stack-config.pp b/elements/puppet-stack-config/puppet-stack-config.pp index cb42409c8..9770ef044 100644 --- a/elements/puppet-stack-config/puppet-stack-config.pp +++ b/elements/puppet-stack-config/puppet-stack-config.pp @@ -380,9 +380,11 @@ include ::nova::scheduler include ::nova::scheduler::filter include ::nova::compute +$neutron_dns_domain = pick(hiera('overcloud_domain_name', $::domain), $::os_service_default) class { '::neutron': rabbit_hosts => [hiera('controller_host')], debug => hiera('debug'), + dns_domain => $neutron_dns_domain } include ::neutron::server @@ -491,7 +493,9 @@ nova_config { } include ::nova::compute::ironic -include ::nova::network::neutron +class { '::nova::network::neutron': + dhcp_domain => $neutron_dns_domain +} # Ironic diff --git a/elements/puppet-stack-config/puppet-stack-config.yaml.template b/elements/puppet-stack-config/puppet-stack-config.yaml.template index 267babce9..96dbcfb12 100644 --- a/elements/puppet-stack-config/puppet-stack-config.yaml.template +++ b/elements/puppet-stack-config/puppet-stack-config.yaml.template @@ -11,6 +11,8 @@ ntp::servers: {{UNDERCLOUD_NTP_SERVERS}} sysctl_settings: {{SYSCTL_SETTINGS}} +overcloud_domain_name: {{OVERCLOUD_DOMAIN_NAME}} + # SSL tripleo::haproxy::service_certificate: {{UNDERCLOUD_SERVICE_CERTIFICATE}} generate_service_certificates: {{GENERATE_SERVICE_CERTIFICATE}} @@ -237,7 +239,6 @@ neutron::debug: "%{hiera('debug')}" neutron::bind_host: {{LOCAL_IP}} neutron::core_plugin: ml2 neutron::dhcp_agents_per_network: 2 -neutron::dns_domain: {{OVERCLOUD_DOMAIN_NAME}} neutron::server::api_workers: "%{::os_workers}" neutron::server::rpc_workers: "%{::os_workers}" neutron::rabbit_password: {{UNDERCLOUD_RABBIT_PASSWORD}} @@ -405,7 +406,6 @@ nova::api_database_connection: mysql+pymysql://nova_api:{{UNDERCLOUD_NOVA_PASSWO nova::placement_database_connection: mysql+pymysql://nova_placement:{{UNDERCLOUD_NOVA_PASSWORD}}@{{LOCAL_IP}}/nova_placement nova::notify_on_state_change: 'vm_and_task_state' nova::scheduler::enabled: true -nova::network::neutron::dhcp_domain: {{OVERCLOUD_DOMAIN_NAME}} nova::compute::force_config_drive: true nova::compute::reserved_host_memory: '0' nova::compute::vnc_enabled: false diff --git a/instack_undercloud/undercloud.py b/instack_undercloud/undercloud.py index e1ac67893..54cd4a685 100644 --- a/instack_undercloud/undercloud.py +++ b/instack_undercloud/undercloud.py @@ -152,10 +152,12 @@ _opts = [ default=[], help=('List of ntp servers to use.')), cfg.StrOpt('overcloud_domain_name', - default='localdomain', + default='', help=('DNS domain name to use when deploying the overcloud. ' 'The overcloud parameter "CloudDomain" must be set to a ' - 'matching value.') + 'matching value. When unset, the installation will try ' + 'to use the undercloud\'s domain name, and if that fails ' + 'it\'ll use the default from neutron.conf.') ), cfg.StrOpt('undercloud_service_certificate', default='', diff --git a/releasenotes/notes/Make-dns_domain-configurable-1411b51b65b83ded.yaml b/releasenotes/notes/Make-dns_domain-configurable-1411b51b65b83ded.yaml new file mode 100644 index 000000000..40843dc65 --- /dev/null +++ b/releasenotes/notes/Make-dns_domain-configurable-1411b51b65b83ded.yaml @@ -0,0 +1,7 @@ +--- +features: + - the dns_domain parameter in neutron.conf is now configurable through the + overcloud_domain_name configuration parameter in undercloud.conf. In the + absence of this parameter, the installation will try to use the domain + from the undercloud, and if this fails, it will then just use the default + from neutron.conf.