Skip to content

Commit

Permalink
Merge pull request voxpupuli#272 from DracoBlue/custom-template
Browse files Browse the repository at this point in the history
Make template for nginx.conf.erb configurable
  • Loading branch information
James Fryman committed Mar 19, 2014
2 parents ae99eaf + a0964bf commit fbc5b6e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
$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,
$proxy_conf_template = $nginx::params::nx_proxy_conf_template,
) inherits nginx::params {

if $caller_module_name != $module_name {
Expand Down Expand Up @@ -124,12 +126,12 @@

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":
ensure => file,
content => template('nginx/conf.d/proxy.conf.erb'),
content => template($proxy_conf_template),
}

file { "${nginx::config::nx_temp_dir}/nginx.d":
Expand Down
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
$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,
$proxy_conf_template = $nginx::params::nx_proxy_conf_template,
$nginx_vhosts = {},
$nginx_upstreams = {},
$nginx_locations = {},
Expand Down Expand Up @@ -145,6 +147,8 @@
nginx_error_log => $nginx_error_log,
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'],
}
Expand Down
2 changes: 2 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
$nx_run_dir = '/var/nginx'

$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
Expand Down

0 comments on commit fbc5b6e

Please sign in to comment.