aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystems
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-11-25 13:24:38 -0200
committerSilvio Rhatto <rhatto@riseup.net>2011-11-25 13:24:38 -0200
commitb6e8be209eaf98d859e353f39b98d4703785d692 (patch)
tree055d03f5a1d20c2a807ff1eb5a509db9e591373a /manifests/subsystems
parentd998121dc8b1297428d691a1bed93d0b83390f9e (diff)
downloadpuppet-nodo-b6e8be209eaf98d859e353f39b98d4703785d692.tar.gz
puppet-nodo-b6e8be209eaf98d859e353f39b98d4703785d692.tar.bz2
Adding domain-check script
Diffstat (limited to 'manifests/subsystems')
-rw-r--r--manifests/subsystems/domain.pp35
1 files changed, 35 insertions, 0 deletions
diff --git a/manifests/subsystems/domain.pp b/manifests/subsystems/domain.pp
new file mode 100644
index 0000000..b4d0954
--- /dev/null
+++ b/manifests/subsystems/domain.pp
@@ -0,0 +1,35 @@
+# See
+# http://prefetch.net/code/domain-check
+# http://www.cyberciti.biz/tips/howto-monitor-domain-expiration-renew-date.html
+# http://www.cyberciti.biz/tips/domain-check-script.html
+class domain {
+ file { "/usr/local/bin/domain-check":
+ ensure => present,
+ owner => "root",
+ group => "root",
+ mode => 755,
+ source => "puppet://$server/modules/nodo/bin/domain-check",
+ }
+
+ define check($interval = '60', $email = 'root', $hour = '0',
+ $minute = '0', $weekday = '0',
+ $file = false) {
+
+ $cert_check = "/usr/local/bin/domain-check -a -q -x ${interval} -e ${email}"
+
+ $command = $file ? {
+ true => "$cert_check -f ${file}",
+ false,default => "$cert_check -d ${name}",
+ }
+
+ cron { "domain-check-${name}":
+ command => $command,
+ user => root,
+ hour => $hour,
+ minute => $minute,
+ weekday => $weekday,
+ ensure => present,
+ require => File["/usr/local/bin/domain-check"],
+ }
+ }
+}