2011-06-07 01:05:27 +02:00
|
|
|
# Class: nginx::package
|
|
|
|
#
|
|
|
|
# This module manages NGINX package installation
|
|
|
|
#
|
|
|
|
# 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 16:27:17 +02:00
|
|
|
class nginx::package(
|
|
|
|
$package_name = 'nginx',
|
|
|
|
$package_source = 'nginx',
|
|
|
|
$package_ensure = 'present',
|
2013-10-07 21:46:42 +02:00
|
|
|
$manage_repo = true,
|
2013-10-07 16:27:17 +02:00
|
|
|
) {
|
2014-01-06 22:26:16 +01:00
|
|
|
|
2011-06-21 21:03:47 +02:00
|
|
|
anchor { 'nginx::package::begin': }
|
|
|
|
anchor { 'nginx::package::end': }
|
|
|
|
|
2013-07-29 01:43:00 +02:00
|
|
|
case $::osfamily {
|
|
|
|
'redhat': {
|
2011-06-21 21:03:47 +02:00
|
|
|
class { 'nginx::package::redhat':
|
2013-10-07 21:46:42 +02:00
|
|
|
manage_repo => $manage_repo,
|
|
|
|
package_ensure => $package_ensure,
|
2013-10-16 16:02:29 +02:00
|
|
|
package_name => $package_name,
|
2013-10-07 21:46:42 +02:00
|
|
|
require => Anchor['nginx::package::begin'],
|
|
|
|
before => Anchor['nginx::package::end'],
|
2011-06-21 21:03:47 +02:00
|
|
|
}
|
2013-01-22 19:07:16 +01:00
|
|
|
}
|
2013-07-29 01:43:00 +02:00
|
|
|
'debian': {
|
2013-05-08 14:15:42 +02:00
|
|
|
class { 'nginx::package::debian':
|
2013-10-07 16:27:17 +02:00
|
|
|
package_name => $package_name,
|
|
|
|
package_source => $package_source,
|
|
|
|
package_ensure => $package_ensure,
|
2013-10-07 21:46:42 +02:00
|
|
|
manage_repo => $manage_repo,
|
|
|
|
require => Anchor['nginx::package::begin'],
|
|
|
|
before => Anchor['nginx::package::end'],
|
2011-06-21 21:03:47 +02:00
|
|
|
}
|
2011-06-07 00:25:04 +02:00
|
|
|
}
|
2013-07-29 01:43:00 +02:00
|
|
|
'suse': {
|
2011-06-21 21:03:47 +02:00
|
|
|
class { 'nginx::package::suse':
|
2014-05-28 09:12:28 +02:00
|
|
|
package_name => $package_name,
|
|
|
|
require => Anchor['nginx::package::begin'],
|
|
|
|
before => Anchor['nginx::package::end'],
|
2011-06-21 21:03:47 +02:00
|
|
|
}
|
2011-06-07 00:25:04 +02:00
|
|
|
}
|
2014-05-15 23:55:24 +02:00
|
|
|
'archlinux': {
|
|
|
|
class { 'nginx::package::archlinux':
|
|
|
|
require => Anchor['nginx::package::begin'],
|
|
|
|
before => Anchor['nginx::package::end'],
|
|
|
|
}
|
|
|
|
}
|
2014-01-30 16:41:44 +01:00
|
|
|
'Solaris': {
|
|
|
|
class { 'nginx::package::solaris':
|
|
|
|
package_name => $package_name,
|
|
|
|
package_source => $package_source,
|
|
|
|
package_ensure => $package_ensure,
|
2014-06-04 22:06:37 +02:00
|
|
|
require => Anchor['nginx::package::begin'],
|
|
|
|
before => Anchor['nginx::package::end'],
|
2014-01-30 16:41:44 +01:00
|
|
|
}
|
|
|
|
}
|
2014-07-12 07:36:25 +02:00
|
|
|
'FreeBSD': {
|
|
|
|
class { 'nginx::package::freebsd':
|
|
|
|
package_name => $package_name,
|
|
|
|
package_ensure => $package_ensure,
|
|
|
|
require => Anchor['nginx::package::begin'],
|
|
|
|
before => Anchor['nginx::package::end'],
|
|
|
|
}
|
|
|
|
}
|
2014-09-05 13:13:53 +02:00
|
|
|
'Gentoo': {
|
|
|
|
class { 'nginx::package::gentoo':
|
|
|
|
package_name => $package_name,
|
|
|
|
package_ensure => $package_ensure,
|
|
|
|
require => Anchor['nginx::package::begin'],
|
|
|
|
before => Anchor['nginx::package::end'],
|
|
|
|
}
|
|
|
|
}
|
2013-05-08 14:15:42 +02:00
|
|
|
default: {
|
2013-07-29 01:43:00 +02:00
|
|
|
case $::operatingsystem {
|
|
|
|
'amazon': {
|
|
|
|
# Amazon was added to osfamily RedHat in 1.7.2
|
|
|
|
# https://github.com/puppetlabs/facter/commit/c12d3b6c557df695a7b2b009da099f6a93c7bd31#lib/facter/osfamily.rb
|
|
|
|
warning("Module ${module_name} support for ${::operatingsystem} with facter < 1.7.2 is deprecated")
|
|
|
|
warning("Please upgrade from facter ${::facterversion} to >= 1.7.2")
|
|
|
|
class { 'nginx::package::redhat':
|
|
|
|
require => Anchor['nginx::package::begin'],
|
|
|
|
before => Anchor['nginx::package::end'],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
fail("Module ${module_name} is not supported on ${::operatingsystem}")
|
|
|
|
}
|
|
|
|
}
|
2013-05-08 14:15:42 +02:00
|
|
|
}
|
2011-06-06 17:04:24 +02:00
|
|
|
}
|
2011-06-15 21:40:42 +02:00
|
|
|
}
|