Closed domcleal closed 8 years ago
This PR fails with Puppet 3.4+, saying the grub
provider is not functional.
Yeah, I haven't had chance to revisit, I think the file existence tests are broken.
OK.
I am working on some CentOS 7.0 and RHEL 7.0 systems and am getting the Found multiple default providers for kernel_parameter
warning. Is there a fix for this in the works or should I start hunting around in the code to try and fix it?
I'm pretty sure this fixes it, but I haven't got the tests fixed to merge it - sorry.
Hi,
I actually created a custom fact called 'grubversion' and then I just use that in the grub/grub2 provider to confine:
Facter.add(:grubversion) do
if File.exists?("/boot/grub")
version = 1
elsif File.exists?("/boot/grub2")
version = 2
else
fail("Failed to evaluate grub version")
end
setcode { version }
end
grub legacy provider:
confine :grubversion => 1
grub2 provider:
confine :grubversion => 2
I quite like this as I can also re-use the grubversion fact in my manifests etc.
Cheers, Matteo
On a GRUB 2 system, the GRUB 1 provider will always match as it's only confined on the presence of Augeas and so the behaviour is often random, it might choose the older provider:
Since we'll never create GRUB configurations from scratch, it makes sense to confine these providers to their files, and prefer GRUB 2 over GRUB 1.