Skip to content
Snippets Groups Projects
Commit 34fbb949 authored by Torbjörn Lönnemark's avatar Torbjörn Lönnemark
Browse files

Disable systemd-resolved

Previously, systemd-resolved was installed, but not used.

Starting with systemd-resolved-249.11-1.fc35.x86_64, this changed due to
this change:

> Create /etc/resolv.conf symlink if nothing is present yet (#2032085)

More context in: https://bugzilla.redhat.com/show_bug.cgi?id=2032085

Before this version, resolv.conf was a regular file managed by
NetworkManager.

This commit restores the previous behvaiour by disabling
systemd-resolved, removing /etc/resolv.conf if it is a symlink, and
restarting NetworkManager (so it creates a new resolv.conf).
parent 6a7dbfe2
Branches
No related tags found
Loading
Checking pipeline status
...@@ -17,6 +17,18 @@ class lysnetwork::public_ip ( ...@@ -17,6 +17,18 @@ class lysnetwork::public_ip (
ipv6_dns_servers => ['2001:6b0:17:f0a0::4', '2001:6b0:17:f0a0::e1'], ipv6_dns_servers => ['2001:6b0:17:f0a0::4', '2001:6b0:17:f0a0::e1'],
ipv6_dns_search => 'lysator.liu.se', ipv6_dns_search => 'lysator.liu.se',
} }
# disable systemd-resolved
service { 'systemd-resolved':
ensure => stopped,
enable => false,
}
-> exec { '/usr/bin/rm -f /etc/resolv.conf':
onlyif => '/usr/bin/test -h /etc/resolv.conf',
}
# avoid managing the service by using an exec resource
~> exec { '/usr/bin/systemctl restart NetworkManager':
refreshonly => true,
}
} elsif versioncmp($facts['systemd_version'], '215') >= 0 { } elsif versioncmp($facts['systemd_version'], '215') >= 0 {
case $facts['os']['family'] { case $facts['os']['family'] {
'RedHat': { 'RedHat': {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment