Skip to content

Commit

Permalink
Add Gentoo facts for Facter 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
baurmatt committed Sep 18, 2018
1 parent 1cbfd31 commit 0290891
Show file tree
Hide file tree
Showing 5 changed files with 274 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ FacterDB::get_facts('osfamily=Debian')
| FreeBSD 10 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 1 | | | | | | | | | | 1 | | |
| FreeBSD 11 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | | | | | | | | | | 1 | | |
| FreeBSD 9 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | | | |
| Gentoo | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | | | |
| Gentoo | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | | |
| LinuxMint 18 | | | | | | | | | | 1 | | 1 | | | | | | | | |
| OpenBSD 5.7 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | | | |
| OpenBSD 5.8 | | | 2 | 2 | 2 | 2 | 2 | | | | | | | | | | | | | |
Expand Down
133 changes: 133 additions & 0 deletions facts/2.5/gentoo-i386.facts
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"gem_version": "~> 2.5.0",
"rubyplatform": "i386-linux",
"system_uptime": {
"seconds": 335,
"hours": 0,
"days": 0,
"uptime": "0:05 hours"
},
"id": "root",
"uptime": "0:05 hours",
"facterversion": "2.5.1",
"os": {
"name": "Gentoo",
"family": "Gentoo",
"release": {
"major": "4",
"minor": "14",
"full": "4.14.65-gentoo"
}
},
"uptime_hours": 0,
"osfamily": "Gentoo",
"ipaddress": "10.0.2.15",
"timezone": "PDT",
"operatingsystemmajrelease": "4",
"interfaces": "eth0,lo,sit0",
"kernel": "Linux",
"ipaddress_eth0": "10.0.2.15",
"macaddress_eth0": "08:00:27:5a:63:33",
"netmask_eth0": "255.255.255.0",
"mtu_eth0": 1500,
"ipaddress_lo": "127.0.0.1",
"netmask_lo": "255.0.0.0",
"mtu_lo": 65536,
"mtu_sit0": 1480,
"kernelmajversion": "4.14",
"hardwareisa": "Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz",
"partitions": {
"sda4": {
"uuid": "446f6f32-1db0-4c83-82b8-f2ef512339a0",
"size": "58355712",
"mount": "/",
"label": "ROOT",
"filesystem": "ext4"
},
"sda2": {
"uuid": "d2fedc07-cf2e-4c98-8e0a-613735b799d6",
"size": "499712",
"mount": "/boot",
"label": "BOOT",
"filesystem": "ext4"
},
"sda3": {
"uuid": "5edc67e3-c062-4b08-b867-c98b5afd8f90",
"size": "7999488",
"label": "SWAP",
"filesystem": "swap"
},
"sda1": {
"size": "249856",
"label": "BIOS"
}
},
"rubysitedir": "/usr/lib64/ruby/site_ruby/2.3.0",
"ps": "ps -ef",
"virtual": "kvm",
"is_virtual": true,
"netmask": "255.255.255.0",
"physicalprocessorcount": 1,
"kernelversion": "4.14.65",
"macaddress": "08:00:27:5a:63:33",
"operatingsystemrelease": "4.14.65-gentoo",
"hostname": "foo",
"uniqueid": "007f0100",
"uptime_seconds": 335,
"path": "/home/vagrant/vendor/bundler/ruby/2.3.0/bin:/opt/puppetlabs/puppet/bin:/opt/puppetlabs/bin:/usr/i386-pc-linux-gnu/gcc-bin/7.3.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin",
"filesystems": "ext2,ext3,ext4,iso9660,msdos,vfat,vxfs,xfs",
"rubyversion": "2.3.7",
"processors": {
"models": [
"Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz",
"Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz"
],
"count": 2,
"physicalcount": 1
},
"architecture": "i386",
"hardwaremodel": "i386",
"operatingsystem": "Gentoo",
"kernelrelease": "4.14.65-gentoo",
"processor0": "Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz",
"processor1": "Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz",
"processorcount": 2,
"network_eth0": "10.0.2.0",
"network_lo": "127.0.0.0",
"domain": "example.com",
"memorysize": "1.94 GB",
"memoryfree": "1.85 GB",
"swapsize": "3.81 GB",
"swapfree": "3.81 GB",
"swapsize_mb": "3906.00",
"swapfree_mb": "3906.00",
"memorysize_mb": "1991.04",
"memoryfree_mb": "1898.45",
"uptime_days": 0,
"selinux": false,
"sshdsakey": "AAAAB3NzaC1kc3MAAACBAKc66KBQLq9dvRznaQEqmIT+le3ebiBKZR9aqFSGBJJvDme3xrL+ywNuBTJD11WUHu35JNBtmdruZSxNNjqGdr68i4+QYqSFXOYUZKiPI9h8krxCZEHT5MEQ9NfmGVcUMgWKPDRhw05tbnwZa60NKiz8EmbxZ2+LyQ4TwU6xFzoDAAAAFQC1PtPwy/Hm44WakpT8/Fooq4kCNQAAAH9EteowHQASwJTvAfS0CmbdTOrVJHLTmy4BMRqX7eNlbHCnlb821fMgXcPWSIjLj+hZHOIwwc2udldeEAuwIwxh2/ToSHHvQ8maWvq+qKdBBv+fWJ1VGrJhRJB59KkB2d9YVEQXivZCriTVZKmGPq/ijG/1q/vDQ/vCDIMmxlKRAAAAgBoXWtf4KALh8y8EOSp2wskyWzic58x+aJbmKqvd30O37244mWUSszyNIUr9WPQNmUyjHfFjVphOU96NMT2IHLDOx1hYuuPL4mECqZp4mqVhsrT5XOPcm6tcISL07Kgm52OrirnC8dnnOfnhRUk2i8acGvuYFeY8VlM+ze0OhDO4",
"sshfp_dsa": "SSHFP 2 1 e91a4497fe348fa8ea09abd0d81a3bebc05d2ec3\nSSHFP 2 2 3522f08c2a1c5c234d633387ff029ed01294ace133b575ed74c59145e58d2479",
"sshrsakey": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCgHSBPb7rQjncPwz1GAAlf1eMVUUezV6qH7Bqnwc9lWl0JIzQpSrdk7NwMvmDwb1Z5IysToLkraRcxbgbWT9NWiKywY4YZN8p0km40W6KUgFs/6xSWyyIoNP4vqhJY6PFCZ7/FZWtAx+c8xabGWFX1pH8/tAELC2HCyhIyph4n5KF75SGmznlW/1fzoO5PG/CJyGkC142yLiBL5xIrTVGia6KFoAuiBqWdjjjPKj2VpGAh4hzyR9u+U4N9sfhFjdrXgC+s8mdyvxT/f8ih2FsngqeMa/4NjJchjRCpwiXHGAXgxU80Y3F3s/urf1TAWfYlrVTVRCGA/DFDW+QhF+QN",
"sshfp_rsa": "SSHFP 1 1 eeb258fa2b97ba779fc3df8e26da8875b366c5dc\nSSHFP 1 2 054b278f60d0662e4114d0af40a1bcb50665e59c91f90b69fd22026c9b9ad207",
"sshecdsakey": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKtRNpn5jviewAOq0j3iG0IEf4TGfl3SDJ/ugiTDY6bHbgldeb9ClLO/3RTKM3rx3Zr/LfWhea6vlYKvIKcdd9c=",
"sshfp_ecdsa": "SSHFP 3 1 4bb8a63da005774ebdc9fda84dc6e413f4ba4eee\nSSHFP 3 2 1bb9856b71599f5750e7ebb63ec96aba5370c5bf62975990365917a4e927e54c",
"sshed25519key": "AAAAC3NzaC1lZDI1NTE5AAAAIP3oBZt9VwDlFJAbvQ1+vBdWQpo4mAyhkHzw9qbrK7cp",
"sshfp_ed25519": "SSHFP 4 1 e1cc957be30281395a4108989e147012a623658e\nSSHFP 4 2 f84b0dcb3428d4a1919d881f9a4f91cd16ffc40d7be69311a912b2f036e283f0",
"blockdevice_sda_size": 34359738368,
"blockdevice_sda_vendor": "ATA",
"blockdevice_sda_model": "VBOX HARDDISK",
"blockdevices": "sda",
"gid": "root",
"boardmanufacturer": "Oracle Corporation",
"boardproductname": "VirtualBox",
"boardserialnumber": "0",
"bios_vendor": "innotek GmbH",
"bios_version": "VirtualBox",
"bios_release_date": "12/01/2006",
"manufacturer": "innotek GmbH",
"productname": "VirtualBox",
"serialnumber": "0",
"uuid": "A96D56F5-5354-47CF-81CC-56DA72E2FD7B",
"type": "Other",
"fqdn": "foo.example.com"
}
133 changes: 133 additions & 0 deletions facts/2.5/gentoo-x86_64.facts
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"gem_version": "~> 2.5.0",
"rubyplatform": "x86_64-linux",
"system_uptime": {
"seconds": 335,
"hours": 0,
"days": 0,
"uptime": "0:05 hours"
},
"id": "root",
"uptime": "0:05 hours",
"facterversion": "2.5.1",
"os": {
"name": "Gentoo",
"family": "Gentoo",
"release": {
"major": "4",
"minor": "14",
"full": "4.14.65-gentoo"
}
},
"uptime_hours": 0,
"osfamily": "Gentoo",
"ipaddress": "10.0.2.15",
"timezone": "PDT",
"operatingsystemmajrelease": "4",
"interfaces": "eth0,lo,sit0",
"kernel": "Linux",
"ipaddress_eth0": "10.0.2.15",
"macaddress_eth0": "08:00:27:5a:63:33",
"netmask_eth0": "255.255.255.0",
"mtu_eth0": 1500,
"ipaddress_lo": "127.0.0.1",
"netmask_lo": "255.0.0.0",
"mtu_lo": 65536,
"mtu_sit0": 1480,
"kernelmajversion": "4.14",
"hardwareisa": "Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz",
"partitions": {
"sda4": {
"uuid": "446f6f32-1db0-4c83-82b8-f2ef512339a0",
"size": "58355712",
"mount": "/",
"label": "ROOT",
"filesystem": "ext4"
},
"sda2": {
"uuid": "d2fedc07-cf2e-4c98-8e0a-613735b799d6",
"size": "499712",
"mount": "/boot",
"label": "BOOT",
"filesystem": "ext4"
},
"sda3": {
"uuid": "5edc67e3-c062-4b08-b867-c98b5afd8f90",
"size": "7999488",
"label": "SWAP",
"filesystem": "swap"
},
"sda1": {
"size": "249856",
"label": "BIOS"
}
},
"rubysitedir": "/usr/lib64/ruby/site_ruby/2.3.0",
"ps": "ps -ef",
"virtual": "kvm",
"is_virtual": true,
"netmask": "255.255.255.0",
"physicalprocessorcount": 1,
"kernelversion": "4.14.65",
"macaddress": "08:00:27:5a:63:33",
"operatingsystemrelease": "4.14.65-gentoo",
"hostname": "foo",
"uniqueid": "007f0100",
"uptime_seconds": 335,
"path": "/home/vagrant/vendor/bundler/ruby/2.3.0/bin:/opt/puppetlabs/puppet/bin:/opt/puppetlabs/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/7.3.0:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin",
"filesystems": "ext2,ext3,ext4,iso9660,msdos,vfat,vxfs,xfs",
"rubyversion": "2.3.7",
"processors": {
"models": [
"Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz",
"Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz"
],
"count": 2,
"physicalcount": 1
},
"architecture": "amd64",
"hardwaremodel": "x86_64",
"operatingsystem": "Gentoo",
"kernelrelease": "4.14.65-gentoo",
"processor0": "Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz",
"processor1": "Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz",
"processorcount": 2,
"network_eth0": "10.0.2.0",
"network_lo": "127.0.0.0",
"domain": "example.com",
"memorysize": "1.94 GB",
"memoryfree": "1.85 GB",
"swapsize": "3.81 GB",
"swapfree": "3.81 GB",
"swapsize_mb": "3906.00",
"swapfree_mb": "3906.00",
"memorysize_mb": "1991.04",
"memoryfree_mb": "1898.45",
"uptime_days": 0,
"selinux": false,
"sshdsakey": "AAAAB3NzaC1kc3MAAACBAKc66KBQLq9dvRznaQEqmIT+le3ebiBKZR9aqFSGBJJvDme3xrL+ywNuBTJD11WUHu35JNBtmdruZSxNNjqGdr68i4+QYqSFXOYUZKiPI9h8krxCZEHT5MEQ9NfmGVcUMgWKPDRhw05tbnwZa60NKiz8EmbxZ2+LyQ4TwU6xFzoDAAAAFQC1PtPwy/Hm44WakpT8/Fooq4kCNQAAAH9EteowHQASwJTvAfS0CmbdTOrVJHLTmy4BMRqX7eNlbHCnlb821fMgXcPWSIjLj+hZHOIwwc2udldeEAuwIwxh2/ToSHHvQ8maWvq+qKdBBv+fWJ1VGrJhRJB59KkB2d9YVEQXivZCriTVZKmGPq/ijG/1q/vDQ/vCDIMmxlKRAAAAgBoXWtf4KALh8y8EOSp2wskyWzic58x+aJbmKqvd30O37244mWUSszyNIUr9WPQNmUyjHfFjVphOU96NMT2IHLDOx1hYuuPL4mECqZp4mqVhsrT5XOPcm6tcISL07Kgm52OrirnC8dnnOfnhRUk2i8acGvuYFeY8VlM+ze0OhDO4",
"sshfp_dsa": "SSHFP 2 1 e91a4497fe348fa8ea09abd0d81a3bebc05d2ec3\nSSHFP 2 2 3522f08c2a1c5c234d633387ff029ed01294ace133b575ed74c59145e58d2479",
"sshrsakey": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCgHSBPb7rQjncPwz1GAAlf1eMVUUezV6qH7Bqnwc9lWl0JIzQpSrdk7NwMvmDwb1Z5IysToLkraRcxbgbWT9NWiKywY4YZN8p0km40W6KUgFs/6xSWyyIoNP4vqhJY6PFCZ7/FZWtAx+c8xabGWFX1pH8/tAELC2HCyhIyph4n5KF75SGmznlW/1fzoO5PG/CJyGkC142yLiBL5xIrTVGia6KFoAuiBqWdjjjPKj2VpGAh4hzyR9u+U4N9sfhFjdrXgC+s8mdyvxT/f8ih2FsngqeMa/4NjJchjRCpwiXHGAXgxU80Y3F3s/urf1TAWfYlrVTVRCGA/DFDW+QhF+QN",
"sshfp_rsa": "SSHFP 1 1 eeb258fa2b97ba779fc3df8e26da8875b366c5dc\nSSHFP 1 2 054b278f60d0662e4114d0af40a1bcb50665e59c91f90b69fd22026c9b9ad207",
"sshecdsakey": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKtRNpn5jviewAOq0j3iG0IEf4TGfl3SDJ/ugiTDY6bHbgldeb9ClLO/3RTKM3rx3Zr/LfWhea6vlYKvIKcdd9c=",
"sshfp_ecdsa": "SSHFP 3 1 4bb8a63da005774ebdc9fda84dc6e413f4ba4eee\nSSHFP 3 2 1bb9856b71599f5750e7ebb63ec96aba5370c5bf62975990365917a4e927e54c",
"sshed25519key": "AAAAC3NzaC1lZDI1NTE5AAAAIP3oBZt9VwDlFJAbvQ1+vBdWQpo4mAyhkHzw9qbrK7cp",
"sshfp_ed25519": "SSHFP 4 1 e1cc957be30281395a4108989e147012a623658e\nSSHFP 4 2 f84b0dcb3428d4a1919d881f9a4f91cd16ffc40d7be69311a912b2f036e283f0",
"blockdevice_sda_size": 34359738368,
"blockdevice_sda_vendor": "ATA",
"blockdevice_sda_model": "VBOX HARDDISK",
"blockdevices": "sda",
"gid": "root",
"boardmanufacturer": "Oracle Corporation",
"boardproductname": "VirtualBox",
"boardserialnumber": "0",
"bios_vendor": "innotek GmbH",
"bios_version": "VirtualBox",
"bios_release_date": "12/01/2006",
"manufacturer": "innotek GmbH",
"productname": "VirtualBox",
"serialnumber": "0",
"uuid": "A96D56F5-5354-47CF-81CC-56DA72E2FD7B",
"type": "Other",
"fqdn": "foo.example.com"
}
3 changes: 2 additions & 1 deletion facts/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
host.vm.provision "shell", inline: "/sbin/shutdown -h now"
end
config.vm.define "gentoo-x86_64" do |host|
host.vm.box = "cmiles/gentoo-amd64-minimal"
host.vm.box = "generic/gentoo"
host.vm.synced_folder ".", "/vagrant"
host.vm.provision "shell", inline: "emerge-webrsync && emerge app-crypt/gnupg net-misc/curl"
host.vm.provision "file", source: "Gemfile", destination: "Gemfile"
host.vm.provision "shell", path: "get_facts.sh"
Expand Down
5 changes: 5 additions & 0 deletions facts/get_facts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ elif test -f /usr/bin/yum; then
elif test -f '/usr/bin/pacman'; then
operatingsystemmajrelease=3
osfamily='Archlinux'
elif test -f '/etc/gentoo-release'; then
osfamily='Gentoo'
else
osfamily=$(uname)
fi
Expand Down Expand Up @@ -109,6 +111,9 @@ case "${osfamily}" in
;;
'Archlinux')
pacman -Syu --noconfirm ruby puppet ruby-bundler
;;
'Gentoo')
emerge -vq1 dev-lang/ruby dev-ruby/bundler app-admin/puppet
esac

operatingsystem=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
Expand Down

0 comments on commit 0290891

Please sign in to comment.