From a454d0003e35a88ea10544fb0e7c90766a65390f Mon Sep 17 00:00:00 2001 From: Sergii Golovatiuk Date: Thu, 16 Apr 2015 13:43:54 +0200 Subject: [PATCH] Create /etc/resolv.conf as a link resolvconf service manages /run/resolvconf/resolv.conf by default on Ubuntu 12.04 and 14.04. resolv.conf should be symlink to it. Closes-Bug: 1434232 Change-Id: I501538326c095e47adafae476c2c3a299509fa84 Signed-off-by: Sergii Golovatiuk --- .../osnailyfacter/manifests/resolvconf.pp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/deployment/puppet/osnailyfacter/manifests/resolvconf.pp b/deployment/puppet/osnailyfacter/manifests/resolvconf.pp index a10f933bd0..11904539af 100644 --- a/deployment/puppet/osnailyfacter/manifests/resolvconf.pp +++ b/deployment/puppet/osnailyfacter/manifests/resolvconf.pp @@ -31,15 +31,29 @@ class osnailyfacter::resolvconf ( } file { $file_path: - ensure => present, + ensure => file, content => template('osnailyfacter/resolv.conf.erb') } if $::osfamily =~ /(Debian|Ubuntu)/ { + package { 'resolvconf': + ensure => present, + } -> + file { '/etc/resolv.conf': + ensure => link, + target => '/run/resolvconf/resolv.conf', + } ~> + exec { 'dpkg-reconfigure resolvconf': + command => '/usr/sbin/dpkg-reconfigure -f noninteractive resolvconf', + refreshonly => true, + } + file {'/etc/default/resolvconf': + content => 'REPORT_ABSENT_SYMLINK="yes"', + } service { 'resolvconf': ensure => running, enable => true, - subscribe => File[$file_path], + subscribe => [ File[$file_path], File['/etc/default/resolvconf'], ] } } }