diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-04-12 17:12:53 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-04-12 17:12:53 -0300 |
commit | 95198a8ccd422a4360907a76a24efabda17c51af (patch) | |
tree | 256b1ef432f8f03a2efd9d3660ca2876c744c235 /manifests | |
download | puppet-domain_check-95198a8ccd422a4360907a76a24efabda17c51af.tar.gz puppet-domain_check-95198a8ccd422a4360907a76a24efabda17c51af.tar.bz2 |
Initial import
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 13 | ||||
-rw-r--r-- | manifests/instance.pp | 30 |
2 files changed, 43 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..a321919 --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,13 @@ +# 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_check { + file { "/usr/local/bin/domain-check": + ensure => present, + owner => "root", + group => "root", + mode => 755, + source => "puppet:///modules/domain_check/domain-check", + } +} diff --git a/manifests/instance.pp b/manifests/instance.pp new file mode 100644 index 0000000..0148728 --- /dev/null +++ b/manifests/instance.pp @@ -0,0 +1,30 @@ +define domain_check::instance( + $interval = '60', + $email = 'root', + $hour = '0', + $minute = '0', + $weekday = '0', + $file = false, + $ensure = present +) { + $cert_check = "/usr/local/bin/domain-check -a -q -x ${interval} -e ${email}" + + case $file { + true: { + $command = "$cert_check -f ${file}" + } + false, default: { + $command = "$cert_check -d ${name}" + } + } + + cron { "domain-check-${name}": + command => "$command >/dev/null 2>&1", + user => root, + hour => $hour, + minute => $minute, + weekday => $weekday, + ensure => $ensure, + require => File["/usr/local/bin/domain-check"], + } +} |