diff --git a/lib/puppet/provider/grub_config/grub2.rb b/lib/puppet/provider/grub_config/grub2.rb index 429a618..6ae30c8 100644 --- a/lib/puppet/provider/grub_config/grub2.rb +++ b/lib/puppet/provider/grub_config/grub2.rb @@ -20,7 +20,12 @@ def self.mkconfig_path end confine feature: :augeas - commands mkconfig: mkconfig_path + + confine exists: mkconfig_path, for_binary: true + + def mkconfig + execute(self.class.mkconfig_path, { failonfail: true, combine: false }) + end defaultfor osfamily: :RedHat diff --git a/lib/puppet/provider/grub_menuentry/grub2.rb b/lib/puppet/provider/grub_menuentry/grub2.rb index 0b2080f..a9797a6 100644 --- a/lib/puppet/provider/grub_menuentry/grub2.rb +++ b/lib/puppet/provider/grub_menuentry/grub2.rb @@ -250,7 +250,12 @@ def self.prefetch(resources) #### End Class Methods - commands mkconfig: mkconfig_path + confine exists: mkconfig_path, for_binary: true + + def mkconfig + execute(self.class.mkconfig_path, { failonfail: true, combine: false }) + end + commands grubby: 'grubby' commands grub_set_default: 'grub2-set-default' diff --git a/lib/puppet/provider/grub_user/grub2.rb b/lib/puppet/provider/grub_user/grub2.rb index 817b2ad..01ea87f 100644 --- a/lib/puppet/provider/grub_user/grub2.rb +++ b/lib/puppet/provider/grub_user/grub2.rb @@ -14,7 +14,11 @@ def self.mkconfig_path which('grub2-mkconfig') or which('grub-mkconfig') or '/usr/sbin/grub-mkconfig' end - commands mkconfig: mkconfig_path + confine exists: mkconfig_path, for_binary: true + + def mkconfig + execute(self.class.mkconfig_path, { failonfail: true, combine: false }) + end confine exists: '/etc/grub.d' diff --git a/lib/puppet/provider/kernel_parameter/grub2.rb b/lib/puppet/provider/kernel_parameter/grub2.rb index 94636d6..b7d9c25 100644 --- a/lib/puppet/provider/kernel_parameter/grub2.rb +++ b/lib/puppet/provider/kernel_parameter/grub2.rb @@ -28,7 +28,12 @@ def self.mkconfig_path confine feature: :augeas defaultfor augeasprovider_grub_version: 2 - commands mkconfig: mkconfig_path + + confine exists: mkconfig_path, for_binary: true + + def mkconfig + execute(self.class.mkconfig_path, { failonfail: true, combine: false }) + end # when both grub* providers match, prefer GRUB 2 def self.specificity