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:
Spencer Krum 2015-04-08 03:28:53 -07:00
parent cf9bcbadf1
commit 1b617cee2c
1 changed files with 19 additions and 0 deletions

19
lib/facter/dpkg.rb Normal file
View 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