]> gitweb.fluxo.info Git - puppet-ssl.git/commitdiff
Adding file support for ssl-cert-check
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 29 Mar 2011 22:02:00 +0000 (19:02 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 29 Mar 2011 22:02:00 +0000 (19:02 -0300)
manifests/init.pp

index 99e7125549e7f4bbcefaff3539ab5faf43b4df38..c8d6c0f4185f2a461d327a853ee74d931689c7d0 100644 (file)
@@ -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,