diff options
Diffstat (limited to 'manifests/init.pp')
-rw-r--r-- | manifests/init.pp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 99e7125..c8d6c0f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -32,9 +32,19 @@ class ssl { } define check($port = '443', $interval = '60', $email = 'root', - $hour = '0', $minute = '0', $weekday = '0') { + $hour = '0', $minute = '0', $weekday = '0', + $file = false) { + + $ssl_cert_check = "/usr/local/bin/ssl-cert-check -a -q -x ${interval} -e ${email}" + + $command = $file ? { + false => "$ssl_cert_check -s ${name} -p ${port}", + true => "$ssl_cert_check -c /etc/ssl/certs/cert.crt", + default => "$ssl_cert_check -c ${file} -q -x ${interval} -e ${email}", + } + cron { "ssl-cert-check-${name}": - command => "/usr/local/bin/ssl-cert-check -a -s ${name} -p ${port} -q -x ${interval} -e ${email}", + command => $command, user => root, hour => $hour, minute => $minute, |