diff options
-rw-r--r-- | manifests/service/http.pp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/manifests/service/http.pp b/manifests/service/http.pp index 33921fa..f0390be 100644 --- a/manifests/service/http.pp +++ b/manifests/service/http.pp @@ -16,12 +16,20 @@ define nagios::service::http( 'absent' => $name, default => $check_domain } + if is_hash($check_code) { + $check_code_hash = $check_code + } else { + $check_code_hash = { + http => $check_code, + https => $check_code, + } + } case $ssl_mode { 'force',true,'only': { nagios::service{"https_${name}": ensure => $ensure, use => $use, - check_command => "check_https_url_regex!${real_check_domain}!${check_url}!'${check_code}'", + check_command => "check_https_url_regex!${real_check_domain}!${check_url}!'${check_code_hash[https]}'", } case $ssl_mode { 'force': { @@ -39,7 +47,7 @@ define nagios::service::http( nagios::service{"http_${name}": ensure => $ensure, use => $use, - check_command => "check_http_url_regex!${real_check_domain}!${port}!${check_url}!'${check_code}'", + check_command => "check_http_url_regex!${real_check_domain}!${port}!${check_url}!'${check_code_hash[http]}'", } } } |