2011-06-07 01:05:27 +02:00
|
|
|
# Class: nginx
|
|
|
|
#
|
|
|
|
# This module manages NGINX.
|
|
|
|
#
|
|
|
|
# Parameters:
|
2011-06-15 05:02:55 +02:00
|
|
|
#
|
2011-06-07 01:05:27 +02:00
|
|
|
# There are no default parameters for this class. All module parameters are managed
|
|
|
|
# via the nginx::params class
|
|
|
|
#
|
|
|
|
# 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 (
|
2013-03-27 19:13:52 +01:00
|
|
|
$worker_processes = $nginx::params::nx_worker_processes,
|
|
|
|
$worker_connections = $nginx::params::nx_worker_connections,
|
|
|
|
$proxy_set_header = $nginx::params::nx_proxy_set_header,
|
2013-05-21 16:41:44 +02:00
|
|
|
$proxy_http_version = $nginx::params::nx_proxy_http_version,
|
|
|
|
$confd_purge = $nginx::params::nx_confd_purge,
|
2013-03-27 19:13:52 +01:00
|
|
|
$proxy_cache_path = $nginx::params::nx_proxy_cache_path,
|
|
|
|
$proxy_cache_levels = $nginx::params::nx_proxy_cache_levels,
|
|
|
|
$proxy_cache_keys_zone = $nginx::params::nx_proxy_cache_keys_zone,
|
|
|
|
$proxy_cache_max_size = $nginx::params::nx_proxy_cache_max_size,
|
|
|
|
$proxy_cache_inactive = $nginx::params::nx_proxy_cache_inactive,
|
2013-05-21 14:30:21 +02:00
|
|
|
$configtest_enable = $nginx::params::nx_configtest_enable,
|
2013-06-13 18:44:15 +02:00
|
|
|
$service_restart = $nginx::params::nx_service_restart,
|
2013-05-21 14:30:21 +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-03-27 19:13:52 +01:00
|
|
|
worker_processes => $worker_processes,
|
|
|
|
worker_connections => $worker_connections,
|
|
|
|
proxy_set_header => $proxy_set_header,
|
2013-05-21 14:30:21 +02:00
|
|
|
proxy_http_version => $proxy_http_version,
|
2013-03-27 19:13:52 +01:00
|
|
|
proxy_cache_path => $proxy_cache_path,
|
|
|
|
proxy_cache_levels => $proxy_cache_levels,
|
|
|
|
proxy_cache_keys_zone => $proxy_cache_keys_zone,
|
|
|
|
proxy_cache_max_size => $proxy_cache_max_size,
|
|
|
|
proxy_cache_inactive => $proxy_cache_inactive,
|
2013-05-21 14:30:21 +02:00
|
|
|
confd_purge => $confd_purge,
|
2013-07-02 09:56:30 +02:00
|
|
|
server_tokens => $server_tokens,
|
2013-03-27 19:13:52 +01:00
|
|
|
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-03-16 10:34:07 +01: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
|
|
|
}
|