Created
November 11, 2014 20:18
-
-
Save reidmv/5ef70b8446ae6c336cc5 to your computer and use it in GitHub Desktop.
Yum Repo Updates pattern in Puppet
This file contains hidden or 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
class updates ( | |
$update_repo = 'patchlevel', | |
$enforce = false, | |
) { | |
yumrepo { 'patchlevel': | |
baseurl => "http://${::servername}/patches", | |
descr => 'Patch Level Repo', | |
enabled => 1, | |
gpgcheck => 1, | |
gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6', | |
} | |
exec { 'yum-updates': | |
command => "yum --disablerepo '*' --enablerepo '${update_repo}' update -y", | |
unless => "yum --disablerepo '*' --enablerepo '${update_repo}' check-update", | |
logoutput => true, | |
path => '/usr/bin', | |
noop => !$enforce, | |
require => Yumrepo['patchlevel'], | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment