diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-11-25 13:24:38 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-11-25 13:24:38 -0200 |
commit | b6e8be209eaf98d859e353f39b98d4703785d692 (patch) | |
tree | 055d03f5a1d20c2a807ff1eb5a509db9e591373a /manifests | |
parent | d998121dc8b1297428d691a1bed93d0b83390f9e (diff) | |
download | puppet-nodo-b6e8be209eaf98d859e353f39b98d4703785d692.tar.gz puppet-nodo-b6e8be209eaf98d859e353f39b98d4703785d692.tar.bz2 |
Adding domain-check script
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 1 | ||||
-rw-r--r-- | manifests/master.pp | 3 | ||||
-rw-r--r-- | manifests/nodo.pp | 1 | ||||
-rw-r--r-- | manifests/subsystems/domain.pp | 35 |
4 files changed, 40 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index e717728..98cffe1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -67,6 +67,7 @@ import "subsystems/monkeysphere.pp" import "subsystems/profile.pp" import "subsystems/schroot.pp" import "subsystems/resolver.pp" +import "subsystems/domain.pp" import "subsystems/utils.pp" import "subsystems/utils/debian.pp" import "subsystems/utils/desktop.pp" diff --git a/manifests/master.pp b/manifests/master.pp index 0868192..79cfb72 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -71,4 +71,7 @@ class nodo::master { package { "graphviz": ensure => present, } + + # Check domain registration + domain::check { $domain: } } diff --git a/manifests/nodo.pp b/manifests/nodo.pp index 5fd06db..0cfe743 100644 --- a/manifests/nodo.pp +++ b/manifests/nodo.pp @@ -11,6 +11,7 @@ class nodo { include locales include tunnel include profile + include domain # Set timezone and ntp config # 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"], + } + } +} |