module-nginx/manifests/init.pp

76 lines
2.2 KiB
ObjectPascal
Raw Normal View History

2011-06-07 01:05:27 +02:00
# Class: nginx
#
# This module manages NGINX.
#
# Parameters:
#
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-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
#
# 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
# }
class nginx (
$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-06 11:40:46 +02:00
$proxy_http_version = $nginx::params::nx_proxy_http_version,
$confd_purge = $nginx::params::nx_confd_purge,
$configtest_enable = $nginx::params::nx_configtest_enable,
2013-04-12 13:44:27 +02:00
$service_restart = $nginx::params::nx_service_restart,
$mail = $nginx::params::nx_mail,
$server_tokens = $nginx::params::nx_server_tokens
) inherits nginx::params {
include stdlib
class { 'nginx::package':
2011-06-21 21:03:47 +02:00
notify => Class['nginx::service'],
}
2011-06-21 21:03:47 +02:00
class { 'nginx::config':
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,
confd_purge => $confd_purge,
server_tokens => $server_tokens,
require => Class['nginx::package'],
notify => Class['nginx::service'],
2011-06-21 21:03:47 +02:00
}
2013-05-06 11:37:37 +02:00
class { 'nginx::service':
configtest_enable => $configtest_enable,
2013-05-06 11:37:37 +02:00
service_restart => $service_restart,
}
# 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
}