Fixing merge from latest code on master plus guruhub

This commit is contained in:
Guzmán Brasó 2012-10-02 01:56:37 -03:00
commit e9fce56092
4 changed files with 21 additions and 11 deletions

View file

@ -14,10 +14,10 @@
#
# This class file is not called directly
class nginx::config(
$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,
$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,
) inherits nginx::params {
File {
owner => 'root',
@ -34,6 +34,7 @@ class nginx::config(
}
if $confd_purge == true {
File["${nginx::params::nx_conf_dir}/conf.d"] {
ignore => "vhost_autogen.conf",
purge => true,
recurse => true,
}

View file

@ -29,11 +29,12 @@
# 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,
$confd_purge = $nginx::params::nx_confd_purge,
$configtest_enable = $nginx::params::nx_configtest_enable,
$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,
$configtest_enable = $nginx::params::nx_configtest_enable,
$service_restart = $nginx::params::nx_service_restrart,
) inherits nginx::params {
include stdlib
@ -53,6 +54,7 @@ class nginx (
class { 'nginx::service':
configtest_enable => $configtest_enable,
service_restart => $service_restart,
}
# Allow the end user to establish relationships to the "main" class

View file

@ -19,7 +19,6 @@ class nginx::params {
$nx_conf_dir = '/etc/nginx'
$nx_confd_purge = false
$nx_configtest_enable = false
$nx_worker_processes = 1
$nx_worker_connections = 1024
$nx_multi_accept = off
@ -55,4 +54,11 @@ class nginx::params {
/(?i-mx:debian|ubuntu)/ => 'www-data',
/(?i-mx:fedora|rhel|redhat|centos|suse|opensuse)/ => 'nginx',
}
# Service restart after Nginx 0.7.53 could also be just "/path/to/nginx/bin -s HUP"
# Some init scripts do a configtest, some don't. If configtest_enable it's true
# then service restart will take $nx_service_restart value, forcing configtest.
$nx_configtest_enable = false
$nx_service_restart = "/etc/init.d/nginx configtest && /etc/init.d/nginx restart"
}

View file

@ -15,6 +15,7 @@
# This class file is not called directly
class nginx::service(
$configtest_enable = $nginx::params::nx_configtest_enable,
$service_restart = $nginx::params::nx_service_restart,
) {
exec { 'rebuild-nginx-vhosts':
command => "/bin/cat ${nginx::params::nx_temp_dir}/nginx.d/* > ${nginx::params::nx_conf_dir}/conf.d/vhost_autogen.conf",
@ -31,7 +32,7 @@ class nginx::service(
}
if $configtest_enable == true {
Service["nginx"] {
restart => "/etc/init.d/nginx configtest && /etc/init.d/nginx restart",
restart => $service_restart,
}
}
}