set required variables before template declared
correctly sets www_root in the vhost_header template
This commit is contained in:
parent
43d628d4f0
commit
8292be0748
2 changed files with 19 additions and 19 deletions
|
@ -181,19 +181,6 @@ define nginx::resource::vhost (
|
||||||
default => $error_log,
|
default => $error_log,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Use the File Fragment Pattern to construct the configuration files.
|
|
||||||
# Create the base configuration file reference.
|
|
||||||
if ($listen_port != $ssl_port) {
|
|
||||||
file { "${nginx::config::nx_temp_dir}/nginx.d/${name}-001":
|
|
||||||
ensure => $ensure ? {
|
|
||||||
'absent' => absent,
|
|
||||||
default => 'file',
|
|
||||||
},
|
|
||||||
content => template('nginx/vhost/vhost_header.erb'),
|
|
||||||
notify => Class['nginx::service'],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($ssl == true) and ($ssl_port == $listen_port) {
|
if ($ssl == true) and ($ssl_port == $listen_port) {
|
||||||
$ssl_only = true
|
$ssl_only = true
|
||||||
}
|
}
|
||||||
|
@ -244,6 +231,19 @@ define nginx::resource::vhost (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Use the File Fragment Pattern to construct the configuration files.
|
||||||
|
# Create the base configuration file reference.
|
||||||
|
if ($listen_port != $ssl_port) {
|
||||||
|
file { "${nginx::config::nx_temp_dir}/nginx.d/${name}-001":
|
||||||
|
ensure => $ensure ? {
|
||||||
|
'absent' => absent,
|
||||||
|
default => 'file',
|
||||||
|
},
|
||||||
|
content => template('nginx/vhost/vhost_header.erb'),
|
||||||
|
notify => Class['nginx::service'],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Create a proper file close stub.
|
# Create a proper file close stub.
|
||||||
if ($listen_port != $ssl_port) {
|
if ($listen_port != $ssl_port) {
|
||||||
file { "${nginx::config::nx_temp_dir}/nginx.d/${name}-699": content => template('nginx/vhost/vhost_footer.erb'), }
|
file { "${nginx::config::nx_temp_dir}/nginx.d/${name}-699": content => template('nginx/vhost/vhost_footer.erb'), }
|
||||||
|
|
|
@ -134,12 +134,12 @@ describe 'nginx::resource::vhost' do
|
||||||
' test2 test value 2;',
|
' test2 test value 2;',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
#{
|
{
|
||||||
# :title => 'should set root',
|
:title => 'should set root',
|
||||||
# :attr => 'use_default_location',
|
:attr => 'use_default_location',
|
||||||
# :value => false,
|
:value => false,
|
||||||
# :match => ' root /;',
|
:match => ' root /;',
|
||||||
#},
|
},
|
||||||
{
|
{
|
||||||
:title => 'should not set root',
|
:title => 'should not set root',
|
||||||
:attr => 'use_default_location',
|
:attr => 'use_default_location',
|
||||||
|
|
Loading…
Reference in a new issue