9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/vagrant-dnsconf/cap/ubuntu/set_dnsconf.rb', line 9
def self.set_dnsconf(m, opts)
file = "/etc/systemd/resolved.conf"
opts[:deletes].each do |delete|
m.communicate.sudo("sed -i -e \"s/#{delete}//\" #{file}")
end
opts[:replaces].each do |replace|
m.communicate.sudo("sed -i -e \"s/#{replace[:before]}/#{replace[:after]}/\" #{file}")
end
m.communicate.sudo("sed -i -e \"s/DNSSEC=yes/DNSSEC=no/\" #{file}") unless opts[:dnssec]
m.communicate.sudo("systemctl restart systemd-resolved")
end
|