changeset 301:1bfc290270cc

Fix sa-update by using IPv6 for local DNS cache
author IBBoard <dev@ibboard.co.uk>
date Mon, 17 Feb 2020 18:45:06 +0000
parents 220701d9799b
children 01d1b0f6dbaf
files manifests/templates.pp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/manifests/templates.pp	Mon Feb 17 16:23:04 2020 +0000
+++ b/manifests/templates.pp	Mon Feb 17 18:45:06 2020 +0000
@@ -191,10 +191,10 @@
 	file { '/etc/sysconfig/named':
 		ensure => absent,
 	}
-
 	file { '/etc/resolv.conf':
 		ensure => present,
-		content => "nameserver 127.0.0.1",
+		# "ipaddress" key only exists for machines with IPv4 addresses
+		content => has_key($facts, 'ipaddress') ? { true => "nameserver 127.0.0.1", default => "nameserver ::1" },
 		require => Service['unbound'],
 		tag => 'post-service',
 	}