From: Peter Palfrader Date: Mon, 8 Jan 2018 10:49:08 +0000 (+0100) Subject: only manage grub if we have it X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=0cd07adba505da1317e5d4c5b5af2e46870015c3;p=mirror%2Fdsa-puppet.git only manage grub if we have it --- diff --git a/modules/debian_org/lib/facter/software.rb b/modules/debian_org/lib/facter/software.rb index 169436a9c..595d44a99 100644 --- a/modules/debian_org/lib/facter/software.rb +++ b/modules/debian_org/lib/facter/software.rb @@ -172,3 +172,8 @@ Facter.add("zebra") do FileTest.exist?("/usr/sbin/zebra") end end +Facter.add("update_grub") do + setcode do + FileTest.exist?("/usr/sbin/update-grub") + end +end diff --git a/modules/grub/manifests/init.pp b/modules/grub/manifests/init.pp index 51f3f877b..73ec4eca0 100644 --- a/modules/grub/manifests/init.pp +++ b/modules/grub/manifests/init.pp @@ -25,7 +25,7 @@ class grub { $grub_manage = false } - if $grub_manage { + if ($::update_grub and $grub_manage) { # hp-health requires nopat on linux 4.9 $grub_do_nopat = ($::systemproductname and $::systemproductname =~ /^ProLiant/ and versioncmp($::kernelversion, '4.9') >= 0)