2011-06-07 01:05:27 +02:00
|
|
|
# Class: nginx::config
|
|
|
|
#
|
|
|
|
# This module manages NGINX bootstrap and configuration
|
|
|
|
#
|
|
|
|
# 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
|
2012-09-28 18:59:32 +02:00
|
|
|
class nginx::config(
|
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,
|
2013-04-24 10:42:06 +02:00
|
|
|
$confd_purge = $nginx::params::nx_confd_purge,
|
|
|
|
$server_tokens = $nginx::params::nx_server_tokens
|
2012-09-28 18:59:32 +02:00
|
|
|
) inherits nginx::params {
|
2011-06-15 21:40:42 +02:00
|
|
|
File {
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0644',
|
|
|
|
}
|
|
|
|
|
|
|
|
file { "${nginx::params::nx_conf_dir}":
|
|
|
|
ensure => directory,
|
|
|
|
}
|
|
|
|
|
|
|
|
file { "${nginx::params::nx_conf_dir}/conf.d":
|
|
|
|
ensure => directory,
|
|
|
|
}
|
2012-09-30 10:30:04 +02:00
|
|
|
if $confd_purge == true {
|
|
|
|
File["${nginx::params::nx_conf_dir}/conf.d"] {
|
|
|
|
ignore => "vhost_autogen.conf",
|
|
|
|
purge => true,
|
|
|
|
recurse => true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
add support for mail module
See http://wiki.nginx.org/Modules#Mail_modules
Sample Usage:
nginx::resource::mailhost { 'domain1.example':
ensure => present,
auth_http => 'server2.example/cgi-bin/auth',
protocol => 'smtp',
listen_port => 587,
ssl_port => 465,
starttls => 'only',
xclient => 'off',
ssl => 'true',
ssl_cert => '/tmp/server.crt',
ssl_key => '/tmp/server.pem',
}
2013-03-11 14:05:00 +01:00
|
|
|
file { "${nginx::params::nx_conf_dir}/conf.mail.d":
|
|
|
|
ensure => directory,
|
|
|
|
}
|
|
|
|
if $confd_purge == true {
|
|
|
|
File["${nginx::params::nx_conf_dir}/conf.mail.d"] {
|
|
|
|
ignore => "vhost_autogen.conf",
|
|
|
|
purge => true,
|
|
|
|
recurse => true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-06-15 21:40:42 +02:00
|
|
|
|
|
|
|
file { "${nginx::config::nx_run_dir}":
|
|
|
|
ensure => directory,
|
|
|
|
}
|
|
|
|
|
|
|
|
file { "${nginx::config::nx_client_body_temp_path}":
|
|
|
|
ensure => directory,
|
|
|
|
owner => $nginx::params::nx_daemon_user,
|
|
|
|
}
|
|
|
|
|
|
|
|
file {"${nginx::config::nx_proxy_temp_path}":
|
|
|
|
ensure => directory,
|
|
|
|
owner => $nginx::params::nx_daemon_user,
|
|
|
|
}
|
|
|
|
|
|
|
|
file { '/etc/nginx/sites-enabled/default':
|
|
|
|
ensure => absent,
|
|
|
|
}
|
|
|
|
|
|
|
|
file { "${nginx::params::nx_conf_dir}/nginx.conf":
|
|
|
|
ensure => file,
|
|
|
|
content => template('nginx/conf.d/nginx.conf.erb'),
|
|
|
|
}
|
|
|
|
|
|
|
|
file { "${nginx::params::nx_conf_dir}/conf.d/proxy.conf":
|
|
|
|
ensure => file,
|
|
|
|
content => template('nginx/conf.d/proxy.conf.erb'),
|
|
|
|
}
|
|
|
|
|
|
|
|
file { "${nginx::config::nx_temp_dir}/nginx.d":
|
|
|
|
ensure => directory,
|
|
|
|
purge => true,
|
|
|
|
recurse => true,
|
|
|
|
}
|
add support for mail module
See http://wiki.nginx.org/Modules#Mail_modules
Sample Usage:
nginx::resource::mailhost { 'domain1.example':
ensure => present,
auth_http => 'server2.example/cgi-bin/auth',
protocol => 'smtp',
listen_port => 587,
ssl_port => 465,
starttls => 'only',
xclient => 'off',
ssl => 'true',
ssl_cert => '/tmp/server.crt',
ssl_key => '/tmp/server.pem',
}
2013-03-11 14:05:00 +01:00
|
|
|
|
|
|
|
file { "${nginx::config::nx_temp_dir}/nginx.mail.d":
|
|
|
|
ensure => directory,
|
|
|
|
purge => true,
|
|
|
|
recurse => true,
|
|
|
|
}
|
2011-06-15 21:40:42 +02:00
|
|
|
}
|