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(
|
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',
|
2015-01-23 15:11:42 +01:00
|
|
|
$package_flavor = undef,
|
2014-12-10 04:24:53 +01:00
|
|
|
$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': }
|
|
|
|
|
2013-07-29 01:43:00 +02:00
|
|
|
case $::osfamily {
|
|
|
|
'redhat': {
|
2014-11-27 05:33:57 +01:00
|
|
|
class { '::nginx::package::redhat':
|
2013-10-07 21:46:42 +02:00
|
|
|
manage_repo => $manage_repo,
|
2014-12-10 02:05:31 +01:00
|
|
|
package_source => $package_source,
|
2013-10-07 21:46:42 +02:00
|
|
|
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': {
|
2014-11-27 05:33:57 +01: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
|
|
|
}
|
2014-01-30 16:41:44 +01:00
|
|
|
'Solaris': {
|
2014-12-08 03:16:52 +01:00
|
|
|
# $package_name needs to be specified. SFEnginx,CSWnginx depending on
|
|
|
|
# where you get it.
|
2014-12-08 03:17:37 +01:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
2015-01-23 15:11:42 +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:
|
2014-12-08 02:55:41 +01:00
|
|
|
ensure => $package_ensure,
|
2013-07-29 01:43:00 +02:00
|
|
|
}
|
2013-05-08 14:15:42 +02:00
|
|
|
}
|
2011-06-06 17:04:24 +02:00
|
|
|
}
|
2011-06-15 21:40:42 +02:00
|
|
|
}
|