aboutsummaryrefslogtreecommitdiff
path: root/manifests/check.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/check.pp')
-rw-r--r--manifests/check.pp29
1 files changed, 29 insertions, 0 deletions
diff --git a/manifests/check.pp b/manifests/check.pp
new file mode 100644
index 0000000..46030ee
--- /dev/null
+++ b/manifests/check.pp
@@ -0,0 +1,29 @@
+define ssl::check(
+ $port = '443',
+ $interval = '60',
+ $email = 'root',
+ $hour = '0',
+ $minute = '0',
+ $weekday = '0',
+ $file = false,
+ $ensure = present,
+ $base = '/etc/ssl'
+) {
+ $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 ${base}/certs/cert.crt",
+ default => "$ssl_cert_check -c ${file}",
+ }
+
+ cron { "ssl-cert-check-${name}":
+ command => $command,
+ user => root,
+ hour => $hour,
+ minute => $minute,
+ weekday => $weekday,
+ ensure => $ensure,
+ require => File["/usr/local/bin/ssl-cert-check"],
+ }
+}