Merge pull request #28 from guruHub/pull_feature_stub_status

Feature status locations
This commit is contained in:
James Fryman 2012-10-03 06:16:23 -07:00
commit c63df59d12
2 changed files with 9 additions and 2 deletions

View file

@ -13,6 +13,7 @@
# [*proxy_read_timeout*] - Override the default the proxy read timeout value of 90 seconds # [*proxy_read_timeout*] - Override the default the proxy read timeout value of 90 seconds
# [*ssl*] - Indicates whether to setup SSL bindings for this location. # [*ssl*] - Indicates whether to setup SSL bindings for this location.
# [*location_alias*] - Path to be used as basis for serving requests for this location # [*location_alias*] - Path to be used as basis for serving requests for this location
# [*stub_status*] - If true it will point configure module stub_status to provide nginx stats on location
# [*option*] - Reserved for future use # [*option*] - Reserved for future use
# #
# Actions: # Actions:
@ -37,6 +38,7 @@ define nginx::resource::location(
$ssl = false, $ssl = false,
$location_alias = undef, $location_alias = undef,
$option = undef, $option = undef,
$stub_status = undef,
$location $location
) { ) {
File { File {
@ -57,6 +59,8 @@ define nginx::resource::location(
$content_real = template('nginx/vhost/vhost_location_proxy.erb') $content_real = template('nginx/vhost/vhost_location_proxy.erb')
} elsif ($location_alias != undef) { } elsif ($location_alias != undef) {
$content_real = template('nginx/vhost/vhost_location_alias.erb') $content_real = template('nginx/vhost/vhost_location_alias.erb')
} elsif ($stub_status != undef) {
$content_real = template('nginx/vhost/vhost_location_stub_status.erb')
} else { } else {
$content_real = template('nginx/vhost/vhost_location_directory.erb') $content_real = template('nginx/vhost/vhost_location_directory.erb')
} }
@ -65,8 +69,8 @@ define nginx::resource::location(
if ($vhost == undef) { if ($vhost == undef) {
fail('Cannot create a location reference without attaching to a virtual host') fail('Cannot create a location reference without attaching to a virtual host')
} }
if (($www_root == undef) and ($proxy == undef) and ($location_alias == undef)) { if (($www_root == undef) and ($proxy == undef) and ($location_alias == undef) and ($stub_status == undef) ) {
fail('Cannot create a location reference without a www_root, proxy or location_alias defined') fail('Cannot create a location reference without a www_root, proxy, location_alias or stub_status defined')
} }
if (($www_root != undef) and ($proxy != undef)) { if (($www_root != undef) and ($proxy != undef)) {
fail('Cannot define both directory and proxy in a virtual host') fail('Cannot define both directory and proxy in a virtual host')

View file

@ -0,0 +1,3 @@
location <%= location %> {
stub_status on;
}