2011-06-07 01:05:27 +02:00
|
|
|
# Class: nginx::package::redhat
|
|
|
|
#
|
|
|
|
# This module manages NGINX package installation on RedHat based systems
|
|
|
|
#
|
|
|
|
# Parameters:
|
2011-06-15 21:40:42 +02:00
|
|
|
#
|
|
|
|
# There are no default parameters for this class.
|
2011-06-07 01:05:27 +02:00
|
|
|
#
|
|
|
|
# Actions:
|
|
|
|
#
|
|
|
|
# Requires:
|
|
|
|
#
|
|
|
|
# Sample Usage:
|
|
|
|
#
|
|
|
|
# This class file is not called directly
|
2013-10-07 15:36:39 +02:00
|
|
|
class nginx::package::redhat (
|
2013-10-16 16:02:29 +02:00
|
|
|
$manage_repo = true,
|
|
|
|
$package_ensure = 'present',
|
|
|
|
$package_name = 'nginx',
|
2014-12-10 02:05:31 +01:00
|
|
|
$package_source = 'nginx-stable',
|
2013-10-07 15:36:39 +02:00
|
|
|
) {
|
2012-08-27 16:26:48 +02:00
|
|
|
|
2014-12-08 03:02:33 +01:00
|
|
|
#Install the CentOS-specific packages on that OS, otherwise assume it's a RHEL
|
|
|
|
#clone and provide the Red Hat-specific package. This comes into play when not
|
|
|
|
#on RHEL or CentOS and $manage_repo is set manually to 'true'.
|
|
|
|
if $::operatingsystem == 'centos' {
|
|
|
|
$_os = 'centos'
|
|
|
|
} else {
|
|
|
|
$_os = 'rhel'
|
2014-09-21 07:38:29 +02:00
|
|
|
}
|
2012-09-03 20:31:40 +02:00
|
|
|
|
2014-12-10 02:05:31 +01:00
|
|
|
if $manage_repo {
|
|
|
|
case $package_source {
|
|
|
|
'nginx', 'nginx-stable': {
|
2013-09-26 15:32:59 +02:00
|
|
|
yumrepo { 'nginx-release':
|
2014-12-08 03:02:33 +01:00
|
|
|
baseurl => "http://nginx.org/packages/${_os}/${::operatingsystemmajrelease}/\$basearch/",
|
2013-09-26 15:32:59 +02:00
|
|
|
descr => 'nginx repo',
|
|
|
|
enabled => '1',
|
|
|
|
gpgcheck => '1',
|
|
|
|
priority => '1',
|
|
|
|
gpgkey => 'http://nginx.org/keys/nginx_signing.key',
|
2015-04-08 21:16:53 +02:00
|
|
|
before => Package['nginx'],
|
2013-09-26 15:32:59 +02:00
|
|
|
}
|
2013-11-22 04:40:05 +01:00
|
|
|
}
|
2014-12-10 02:05:31 +01:00
|
|
|
'nginx-mainline': {
|
|
|
|
yumrepo { 'nginx-release':
|
|
|
|
baseurl => "http://nginx.org/packages/mainline/${_os}/${::operatingsystemmajrelease}/\$basearch/",
|
|
|
|
descr => 'nginx repo',
|
|
|
|
enabled => '1',
|
|
|
|
gpgcheck => '1',
|
|
|
|
priority => '1',
|
|
|
|
gpgkey => 'http://nginx.org/keys/nginx_signing.key',
|
2015-04-08 21:16:53 +02:00
|
|
|
before => Package['nginx'],
|
2014-12-10 02:05:31 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
fail("\$package_source must be 'nginx-stable' or 'nginx-mainline'. It was set to '${package_source}'")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-07-19 18:04:27 +02:00
|
|
|
|
2014-12-08 03:01:24 +01:00
|
|
|
package { 'nginx':
|
|
|
|
ensure => $package_ensure,
|
|
|
|
name => $package_name,
|
2011-06-15 21:40:42 +02:00
|
|
|
}
|
2013-07-19 18:04:27 +02:00
|
|
|
|
2011-06-15 21:40:42 +02:00
|
|
|
}
|