2011-06-07 01:05:27 +02:00
|
|
|
# Class: nginx
|
|
|
|
#
|
|
|
|
# This module manages NGINX.
|
|
|
|
#
|
|
|
|
# Parameters:
|
2011-06-15 05:02:55 +02:00
|
|
|
#
|
2013-05-06 11:37:37 +02:00
|
|
|
# There are no default parameters for this class. All module parameters are
|
|
|
|
# managed via the nginx::params class
|
2011-06-07 01:05:27 +02:00
|
|
|
#
|
|
|
|
# Actions:
|
|
|
|
#
|
|
|
|
# Requires:
|
2011-06-21 21:03:47 +02:00
|
|
|
# puppetlabs-stdlib - https://github.com/puppetlabs/puppetlabs-stdlib
|
2011-06-15 18:50:55 +02:00
|
|
|
#
|
2011-06-07 01:05:27 +02:00
|
|
|
# Packaged NGINX
|
|
|
|
# - RHEL: EPEL or custom package
|
|
|
|
# - Debian/Ubuntu: Default Install or custom package
|
|
|
|
# - SuSE: Default Install or custom package
|
|
|
|
#
|
2011-06-15 18:50:55 +02:00
|
|
|
# stdlib
|
|
|
|
# - puppetlabs-stdlib module >= 0.1.6
|
|
|
|
# - plugin sync enabled to obtain the anchor type
|
|
|
|
#
|
2011-06-07 01:05:27 +02:00
|
|
|
# Sample Usage:
|
|
|
|
#
|
|
|
|
# The module works with sensible defaults:
|
|
|
|
#
|
|
|
|
# node default {
|
|
|
|
# include nginx
|
|
|
|
# }
|
2012-09-28 18:59:32 +02:00
|
|
|
class nginx (
|
2012-09-30 10:30:04 +02:00
|
|
|
$worker_processes = $nginx::params::nx_worker_processes,
|
|
|
|
$worker_connections = $nginx::params::nx_worker_connections,
|
|
|
|
$proxy_set_header = $nginx::params::nx_proxy_set_header,
|
|
|
|
$confd_purge = $nginx::params::nx_confd_purge,
|
2012-09-30 22:29:55 +02:00
|
|
|
$configtest_enable = $nginx::params::nx_configtest_enable,
|
2013-04-12 13:44:27 +02:00
|
|
|
$service_restart = $nginx::params::nx_service_restart,
|
2013-04-24 10:42:06 +02:00
|
|
|
$mail = $nginx::params::nx_mail,
|
|
|
|
$server_tokens = $nginx::params::nx_server_tokens
|
2012-09-28 18:59:32 +02:00
|
|
|
) inherits nginx::params {
|
2011-06-15 18:50:55 +02:00
|
|
|
|
2012-09-24 16:52:48 +02:00
|
|
|
include stdlib
|
2011-06-15 05:02:55 +02:00
|
|
|
|
2011-06-15 18:50:55 +02:00
|
|
|
class { 'nginx::package':
|
2011-06-21 21:03:47 +02:00
|
|
|
notify => Class['nginx::service'],
|
|
|
|
}
|
2011-06-15 05:02:55 +02:00
|
|
|
|
2011-06-21 21:03:47 +02:00
|
|
|
class { 'nginx::config':
|
2013-04-24 10:42:06 +02:00
|
|
|
worker_processes => $worker_processes,
|
|
|
|
worker_connections => $worker_connections,
|
|
|
|
proxy_set_header => $proxy_set_header,
|
2013-05-06 11:37:37 +02:00
|
|
|
proxy_http_version => $proxy_http_version,
|
2013-04-24 10:42:06 +02:00
|
|
|
confd_purge => $confd_purge,
|
|
|
|
server_tokens => $server_tokens,
|
|
|
|
require => Class['nginx::package'],
|
|
|
|
notify => Class['nginx::service'],
|
2011-06-21 21:03:47 +02:00
|
|
|
}
|
2011-06-15 05:02:55 +02:00
|
|
|
|
2013-05-06 11:37:37 +02:00
|
|
|
class { 'nginx::service':
|
2012-09-30 22:29:55 +02:00
|
|
|
configtest_enable => $configtest_enable,
|
2013-05-06 11:37:37 +02:00
|
|
|
service_restart => $service_restart,
|
2012-09-30 22:29:55 +02:00
|
|
|
}
|
2011-06-15 05:02:17 +02:00
|
|
|
|
2011-06-15 18:50:55 +02:00
|
|
|
# Allow the end user to establish relationships to the "main" class
|
|
|
|
# and preserve the relationship to the implementation classes through
|
|
|
|
# a transitive relationship to the composite class.
|
|
|
|
anchor{ 'nginx::begin':
|
|
|
|
before => Class['nginx::package'],
|
|
|
|
notify => Class['nginx::service'],
|
|
|
|
}
|
2011-06-21 21:03:47 +02:00
|
|
|
anchor { 'nginx::end':
|
|
|
|
require => Class['nginx::service'],
|
|
|
|
}
|
2011-05-25 04:20:48 +02:00
|
|
|
}
|