Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Merge "Use openstack commands when setting dns_servers"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Jul 7, 2021
2 parents 942bfcc + a80b15f commit 96dc904
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -109,12 +109,12 @@ sudo ifup ifcfg-{{ network.device_name }}
## * Set the DNS server in the control plane network
## ::

{% if overcloud_dns_servers|default([]) and release not in ['mitaka', 'newton'] %}
{% if overcloud_dns_servers|default([]) %}
CTLPLANE_SUBNET=$(openstack subnet show ctlplane-subnet -f value -c id)
neutron subnet-update $CTLPLANE_SUBNET \
openstack subnet set $CTLPLANE_SUBNET --no-dns-nameserver \
{% for nameserver in overcloud_dns_servers %} --dns-nameserver "{{ nameserver }}" {% endfor %}
{% else %}
neutron subnet-update $(neutron net-list | awk '/ctlplane/{print $(NF-2) }') $(awk 'match($0, /nameserver\s+(([0-9]{1,3}.?){4})/,address){printf " --dns-nameserver %s", address[1]}' /etc/resolv.conf)
openstack subnet set $(openstack subnet list | awk '/ctlplane/{print $(NF-7) }') $(awk 'match($0, /nameserver\s+(([0-9]{1,3}.?){4})/,address){printf " --dns-nameserver %s", address[1]}' /etc/resolv.conf)
{% endif %}

### --stop_docs

0 comments on commit 96dc904

Please sign in to comment.