aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/init.pp1
-rw-r--r--manifests/master.pp3
-rw-r--r--manifests/nodo.pp1
-rw-r--r--manifests/subsystems/domain.pp35
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"],
+ }
+ }
+}