module-nginx/manifests/package.pp

103 lines
3 KiB
ObjectPascal
Raw Normal View History

2011-06-07 01:05:27 +02:00
# Class: nginx::package
#
# This module manages NGINX package installation
#
# Parameters:
#
# 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',
$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': }
case $::osfamily {
'redhat': {
2011-06-21 21:03:47 +02:00
class { 'nginx::package::redhat':
manage_repo => $manage_repo,
package_ensure => $package_ensure,
2013-10-16 16:02:29 +02:00
package_name => $package_name,
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
}
'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,
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
}
'suse': {
2011-06-21 21:03:47 +02:00
class { 'nginx::package::suse':
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
}
'archlinux': {
class { 'nginx::package::archlinux':
require => Anchor['nginx::package::begin'],
before => Anchor['nginx::package::end'],
}
}
'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'],
}
}
'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: {
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
}
}