Skip to content

Instantly share code, notes, and snippets.

@XANi
Created June 29, 2015 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save XANi/4ed8773dbb69d44b4ac9 to your computer and use it in GitHub Desktop.
Save XANi/4ed8773dbb69d44b4ac9 to your computer and use it in GitHub Desktop.
class yum::nginx {
file {"/etc/pki/rpm-gpg/RPM-GPG-KEY-nginx":
source => "puppet:///modules/yum/nginx.asc",
ensure => present,
owner => root,
group => root,
mode => 644,
}
exec { "nginx_import":
command => "rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-nginx",
require => File["/etc/pki/rpm-gpg/RPM-GPG-KEY-nginx"],
subscribe => File["/etc/pki/rpm-gpg/RPM-GPG-KEY-nginx"],
refreshonly => true,
}
yumrepo { "nginx":
descr => "Official Nginx repo for CentOS",
baseurl => "http://nginx.org/packages/centos/\$releasever/\$basearch",
enabled => 1,
gpgcheck => 1,
gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-nginx",
require => File["/etc/pki/rpm-gpg/RPM-GPG-KEY-nginx"],
notify => Exec["yum_clean"],
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment