Add dpkg architeture facts
Dpkg and debian consider architecture separetly from what the hardware is. These facts expose that to puppet. Create both a normal fact and structured fact. The structured form could be extended to add more dpkg properties. Change-Id: I5b5d5bf6b8d19f4de3bc97d0240fdbda3e3a6a5d
This commit is contained in:
parent
cf9bcbadf1
commit
1b617cee2c
19
lib/facter/dpkg.rb
Normal file
19
lib/facter/dpkg.rb
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Facter.add(:dpkg_arch) do
|
||||||
|
confine :kernel => :linux
|
||||||
|
confine :osfamily => :Debian
|
||||||
|
setcode do
|
||||||
|
arch = Facter::Util::Resolution.exec('dpkg --print-architecture')
|
||||||
|
arch
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Facter.add(:dpkg) do
|
||||||
|
confine :kernel => :linux
|
||||||
|
confine :osfamily => :Debian
|
||||||
|
dpkg = {}
|
||||||
|
setcode do
|
||||||
|
arch = Facter::Util::Resolution.exec('dpkg --print-architecture')
|
||||||
|
dpkg['architecture'] = arch
|
||||||
|
dpkg
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user