Added locations paramater to use it in hiera.
This commit is contained in:
parent
c2571e563f
commit
2db55e9bd0
1 changed files with 11 additions and 1 deletions
|
@ -157,6 +157,7 @@
|
||||||
# [*maintenance*] - A boolean value to set a vhost in maintenance
|
# [*maintenance*] - A boolean value to set a vhost in maintenance
|
||||||
# [*maintenance_value*] - Value to return when maintenance is on.
|
# [*maintenance_value*] - Value to return when maintenance is on.
|
||||||
# Default to return 503
|
# Default to return 503
|
||||||
|
# [*locations*] - Hash of vhosts ressources used by this vhost
|
||||||
# Actions:
|
# Actions:
|
||||||
#
|
#
|
||||||
# Requires:
|
# Requires:
|
||||||
|
@ -267,7 +268,8 @@ define nginx::resource::vhost (
|
||||||
$group = $::nginx::config::global_group,
|
$group = $::nginx::config::global_group,
|
||||||
$mode = $::nginx::config::global_mode,
|
$mode = $::nginx::config::global_mode,
|
||||||
$maintenance = false,
|
$maintenance = false,
|
||||||
$maintenance_value = 'return 503'
|
$maintenance_value = 'return 503',
|
||||||
|
$locations = {}
|
||||||
) {
|
) {
|
||||||
|
|
||||||
validate_re($ensure, '^(present|absent)$',
|
validate_re($ensure, '^(present|absent)$',
|
||||||
|
@ -482,6 +484,7 @@ define nginx::resource::vhost (
|
||||||
validate_array($rewrite_rules)
|
validate_array($rewrite_rules)
|
||||||
validate_hash($string_mappings)
|
validate_hash($string_mappings)
|
||||||
validate_hash($geo_mappings)
|
validate_hash($geo_mappings)
|
||||||
|
validate_hash($locations)
|
||||||
|
|
||||||
validate_string($owner)
|
validate_string($owner)
|
||||||
validate_string($group)
|
validate_string($group)
|
||||||
|
@ -664,4 +667,11 @@ define nginx::resource::vhost (
|
||||||
|
|
||||||
create_resources('::nginx::resource::map', $string_mappings)
|
create_resources('::nginx::resource::map', $string_mappings)
|
||||||
create_resources('::nginx::resource::geo', $geo_mappings)
|
create_resources('::nginx::resource::geo', $geo_mappings)
|
||||||
|
create_resources('::nginx::resource::location', $locations, {
|
||||||
|
ensure => $ensure,
|
||||||
|
vhost => $name_sanitized,
|
||||||
|
ssl => $ssl,
|
||||||
|
ssl_only => $ssl_only,
|
||||||
|
www_root => $www_root,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue