From e5890bf06ea326a6cb47736ce60267334b5d3045 Mon Sep 17 00:00:00 2001 From: Martin Schuette Date: Sun, 1 Jun 2014 23:11:16 +0200 Subject: [PATCH] add own IP to resolv.conf --- manifests/init.pp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index b16627f..30cdf6e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -28,6 +28,10 @@ class ff_gw($ff_net, $ff_mesh_net, $ff_as, $mesh_mac, $gw_ipv4, $gw_ipv6, $secre -> class { 'ff_gw::dnsmasq': } -> + class { 'ff_gw::dns_resolvconf': + gw_ipv4 => $gw_ipv4, + } + -> class { 'ff_gw::bird': ff_net => $ff_net, ff_mesh_net => $ff_mesh_net, @@ -311,6 +315,19 @@ class ff_gw::dnsmasq() { } } +class ff_gw::dns_resolvconf($gw_ipv4) { + # add our own IP as first entry to /etc/resolv.conf + # try to preserve everything else as the default nameserver should be the fastest + augeas { 'edit_resolv_conf': + context => '/files/etc/resolv.conf', + changes => [ + 'ins nameserver before nameserver[1]', + "set nameserver[1] \"${gw_ipv4}\"", + ], + onlyif => "get nameserver[1] != \"${gw_ipv4}\"", + } +} + class ff_gw::radvd($own_ipv6) { package { 'radvd':