Created
October 13, 2016 15:27
-
-
Save GregSutcliffe/b3421aeaff5b06e6d9efbb04f3cabba6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These facts don't update pkg database (apt-get update, pacman -Sy, etc) | |
# Make sure that part is handled by cron, as it can take a while | |
# Archlinux | |
Facter.add('pkg_updates') do | |
confine :operatingsystem => 'Archlinux' | |
setcode do | |
Facter::Core::Execution.exec('/usr/bin/pacman -Qu|/usr/bin/wc -l') | |
end | |
end | |
# Debian | |
Facter.add('pkg_updates') do | |
confine :osfamily => 'Debian' | |
setcode do | |
Facter::Core::Execution.exec("/usr/bin/aptitude search '~U' | /usr/bin/wc -l") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment