From 7e6dcdc1ec60627e8e2f9ddf8c5e092d0359820b Mon Sep 17 00:00:00 2001 From: DracoBlue Date: Mon, 10 Mar 2014 21:19:25 +0100 Subject: [PATCH 1/3] Added config variable for custom nginx.conf template --- manifests/config.pp | 3 ++- manifests/params.pp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/config.pp b/manifests/config.pp index acae8de44..14e976648 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -37,6 +37,7 @@ $http_access_log = $nginx::params::nx_http_access_log, $proxy_buffer_size = $nginx::params::nx_proxy_buffer_size, $gzip = $nginx::params::nx_gzip, + $conf_template = $nginx::params::nx_conf_template, ) inherits nginx::params { if $caller_module_name != $module_name { @@ -123,7 +124,7 @@ file { "${nginx::params::nx_conf_dir}/nginx.conf": ensure => file, - content => template('nginx/conf.d/nginx.conf.erb'), + content => template($conf_template), } file { "${nginx::params::nx_conf_dir}/conf.d/proxy.conf": diff --git a/manifests/params.pp b/manifests/params.pp index a669d910c..b3e887cd6 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -23,6 +23,7 @@ $nx_run_dir = '/var/nginx' $nx_conf_dir = '/etc/nginx' + $nx_conf_template = 'nginx/conf.d/nginx.conf.erb' $nx_confd_purge = false $nx_vhost_purge = false $nx_worker_processes = 1 From 33d3c3001524c0044976ec6f95532e9ddce84bc8 Mon Sep 17 00:00:00 2001 From: DracoBlue Date: Mon, 10 Mar 2014 21:25:08 +0100 Subject: [PATCH 2/3] Added template parameter to nginx class --- manifests/init.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 05b9c0497..629447d4b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -56,6 +56,7 @@ $nginx_error_log = $nginx::params::nx_nginx_error_log, $http_access_log = $nginx::params::nx_http_access_log, $gzip = $nginx::params::nx_gzip, + $conf_template = $nginx::params::nx_conf_template, $nginx_vhosts = {}, $nginx_upstreams = {}, $nginx_locations = {}, @@ -139,6 +140,7 @@ nginx_error_log => $nginx_error_log, http_access_log => $http_access_log, gzip => $gzip, + conf_template => $conf_template, require => Class['nginx::package'], notify => Class['nginx::service'], } From e11e9323652b8fd90e67c0bfa22be4b2ac21bf9b Mon Sep 17 00:00:00 2001 From: DracoBlue Date: Mon, 10 Mar 2014 21:44:46 +0100 Subject: [PATCH 3/3] Added proxy_conf_template option --- manifests/config.pp | 3 ++- manifests/init.pp | 2 ++ manifests/params.pp | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/manifests/config.pp b/manifests/config.pp index 14e976648..c3cc98fc2 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -38,6 +38,7 @@ $proxy_buffer_size = $nginx::params::nx_proxy_buffer_size, $gzip = $nginx::params::nx_gzip, $conf_template = $nginx::params::nx_conf_template, + $proxy_conf_template = $nginx::params::nx_proxy_conf_template, ) inherits nginx::params { if $caller_module_name != $module_name { @@ -129,7 +130,7 @@ file { "${nginx::params::nx_conf_dir}/conf.d/proxy.conf": ensure => file, - content => template('nginx/conf.d/proxy.conf.erb'), + content => template($proxy_conf_template), } file { "${nginx::config::nx_temp_dir}/nginx.d": diff --git a/manifests/init.pp b/manifests/init.pp index 629447d4b..f47541810 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -57,6 +57,7 @@ $http_access_log = $nginx::params::nx_http_access_log, $gzip = $nginx::params::nx_gzip, $conf_template = $nginx::params::nx_conf_template, + $proxy_conf_template = $nginx::params::nx_proxy_conf_template, $nginx_vhosts = {}, $nginx_upstreams = {}, $nginx_locations = {}, @@ -141,6 +142,7 @@ http_access_log => $http_access_log, gzip => $gzip, conf_template => $conf_template, + proxy_conf_template => $proxy_conf_template, require => Class['nginx::package'], notify => Class['nginx::service'], } diff --git a/manifests/params.pp b/manifests/params.pp index b3e887cd6..1a5a73afa 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -24,6 +24,7 @@ $nx_conf_dir = '/etc/nginx' $nx_conf_template = 'nginx/conf.d/nginx.conf.erb' + $nx_proxy_conf_template = 'nginx/conf.d/proxy.conf.erb' $nx_confd_purge = false $nx_vhost_purge = false $nx_worker_processes = 1