From b6e8be209eaf98d859e353f39b98d4703785d692 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 25 Nov 2011 13:24:38 -0200 Subject: Adding domain-check script --- manifests/subsystems/domain.pp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 manifests/subsystems/domain.pp (limited to 'manifests/subsystems') 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"], + } + } +} -- cgit v1.2.3