Skip to content

Commit

Permalink
set required variables before template declared
Browse files Browse the repository at this point in the history
correctly sets www_root in the vhost_header template
  • Loading branch information
Matthew Haughton committed Nov 22, 2013
1 parent 43d628d commit 8292be0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
26 changes: 13 additions & 13 deletions manifests/resource/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,6 @@
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) {
$ssl_only = true
}
Expand Down Expand Up @@ -244,6 +231,19 @@
}
}

# 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.
if ($listen_port != $ssl_port) {
file { "${nginx::config::nx_temp_dir}/nginx.d/${name}-699": content => template('nginx/vhost/vhost_footer.erb'), }
Expand Down
12 changes: 6 additions & 6 deletions spec/defines/resource_vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@
' test2 test value 2;',
],
},
#{
# :title => 'should set root',
# :attr => 'use_default_location',
# :value => false,
# :match => ' root /;',
#},
{
:title => 'should set root',
:attr => 'use_default_location',
:value => false,
:match => ' root /;',
},
{
:title => 'should not set root',
:attr => 'use_default_location',
Expand Down

0 comments on commit 8292be0

Please sign in to comment.