Switch to native systemd-resolved from resolv.conf

Rather than edit resolv.conf, use the recommended method of
operation for systemd-resolved and configure the dns server
through a resolved drop-in.

Change-Id: I1b08a45ccced87ecd200f3e7294165e922df39ff
This commit is contained in:
Jonathan Rosser 2023-09-11 17:08:00 +01:00
parent 03dc91fa85
commit 39542e2c65
1 changed files with 3 additions and 1 deletions

View File

@ -50,6 +50,8 @@ update-locale LANG={{ locale }}
{% endfor %}
# Set the IP of the lxcbr0 interface as the DNS server
echo "nameserver {{ lxc_net_address }}" > /etc/resolv.conf
mkdir -p /etc/systemd/resolved.conf.d
echo "[Resolve]" > /etc/systemd/resolved.conf.d/openstack-ansible.conf
echo "{{ lxc_net_address }}" >> /etc/systemd/resolved.conf.d/openstack-ansible.conf
systemctl enable systemd-networkd
{{ lxc_cache_prep_post_commands }}