module-nginx/manifests/package.pp

74 lines
1.8 KiB
Puppet
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(
2014-12-08 03:16:52 +01:00
$package_name = $::nginx::params::package_name,
2013-10-07 16:27:17 +02:00
$package_source = 'nginx',
$package_ensure = 'present',
$package_flavor = undef,
$manage_repo = $::nginx::params::manage_repo,
2014-12-08 03:16:52 +01:00
) inherits ::nginx::params {
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': {
class { '::nginx::package::redhat':
manage_repo => $manage_repo,
package_source => $package_source,
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': {
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
}
'Solaris': {
2014-12-08 03:16:52 +01:00
# $package_name needs to be specified. SFEnginx,CSWnginx depending on
# where you get it.
if $package_name == undef {
fail('You must supply a value for $package_name on Solaris')
}
2014-12-08 03:16:52 +01:00
package { 'nginx':
ensure => $package_ensure,
name => $package_name,
source => $package_source,
2014-11-25 20:07:40 +01:00
}
}
'OpenBSD': {
package { $package_name:
ensure => $package_ensure,
flavor => $package_flavor,
}
}
2013-05-08 14:15:42 +02:00
default: {
2015-02-16 16:44:11 +01:00
package { $package_name:
ensure => $package_ensure,
}
2013-05-08 14:15:42 +02:00
}
2011-06-06 17:04:24 +02:00
}
}