Created
January 21, 2016 17:32
-
-
Save GregSutcliffe/7c61a6d22de3ab5ab6ce 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 executing it 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 :operatingsystem => '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