diff options
Diffstat (limited to 'manifests/subsystems')
-rw-r--r-- | manifests/subsystems/domain.pp | 35 |
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"], + } + } +} |