From 089717d73525df976e71a514d3d9e6ee5f27441c Mon Sep 17 00:00:00 2001 From: axelrtgs Date: Thu, 22 Dec 2016 16:20:02 -0500 Subject: [PATCH] Updated default.rb to run only on Debian --- recipes/default.rb | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/recipes/default.rb b/recipes/default.rb index c805b12..9929a4a 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -17,22 +17,25 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # +case node['platform_family'] +when "debian" -include_recipe 'resolvconf::install' + include_recipe 'resolvconf::install' -# TODO: This fix needs to be removed once Ubuntu 10.04 support runs out (Q1 2015) -if value_for_platform('ubuntu' => { '10.04' => true }, 'default' => false) - # Fix buggy behaviour of resolvconf in Ubuntu 10.04 (Debian bug #642222) - line = %q(\[ -f "$BASEFILE" \] \&\& RSLVCNFFILES="$BASEFILE) - sfix = %q(\[ -f "$BASEFILE" \] \&\& RSLVCNFFILES="$RSLVCNFFILES\n$BASEFILE") - bash 'fix_resolvconf_libc' do - code <<-EOH - cat /etc/resolvconf/update.d/libc | sed '/#{line}/{N;s/.*/#{sfix}/}' > /tmp/resolvconf_libc_642222.fix - cat /tmp/resolvconf_libc_642222.fix > /etc/resolvconf/update.d/libc - rm /tmp/resolvconf_libc_642222.fix - EOH - only_if "grep -q '#{line}' /etc/resolvconf/update.d/libc" - end -end + # TODO: This fix needs to be removed once Ubuntu 10.04 support runs out (Q1 2015) + if value_for_platform('ubuntu' => { '10.04' => true }, 'default' => false) + # Fix buggy behaviour of resolvconf in Ubuntu 10.04 (Debian bug #642222) + line = %q(\[ -f "$BASEFILE" \] \&\& RSLVCNFFILES="$BASEFILE) + sfix = %q(\[ -f "$BASEFILE" \] \&\& RSLVCNFFILES="$RSLVCNFFILES\n$BASEFILE") + bash 'fix_resolvconf_libc' do + code <<-EOH + cat /etc/resolvconf/update.d/libc | sed '/#{line}/{N;s/.*/#{sfix}/}' > /tmp/resolvconf_libc_642222.fix + cat /tmp/resolvconf_libc_642222.fix > /etc/resolvconf/update.d/libc + rm /tmp/resolvconf_libc_642222.fix + EOH + only_if "grep -q '#{line}' /etc/resolvconf/update.d/libc" + end + end -resolvconf 'default' + resolvconf 'default' +end