summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/cron.pp9
-rw-r--r--manifests/cron/base.pp8
-rw-r--r--manifests/cron/linux.pp12
-rw-r--r--manifests/cron/openbsd.pp22
4 files changed, 51 insertions, 0 deletions
diff --git a/manifests/cron.pp b/manifests/cron.pp
new file mode 100644
index 0000000..9bce6a7
--- /dev/null
+++ b/manifests/cron.pp
@@ -0,0 +1,9 @@
+# manifests/cron.pp
+
+class puppet::cron inherits puppet {
+ case $kernel {
+ linux: { include puppet::cron::linux }
+ openbsd: { include puppet::cron::openbsd }
+ default: { include puppet::cron::base }
+ }
+}
diff --git a/manifests/cron/base.pp b/manifests/cron/base.pp
new file mode 100644
index 0000000..c69b33f
--- /dev/null
+++ b/manifests/cron/base.pp
@@ -0,0 +1,8 @@
+# manifests/cron/base.pp
+
+class puppet::cron::base inherits puppet::base {
+ Service['puppet']{
+ ensure => stopped,
+ enable => false,
+ }
+}
diff --git a/manifests/cron/linux.pp b/manifests/cron/linux.pp
new file mode 100644
index 0000000..1447109
--- /dev/null
+++ b/manifests/cron/linux.pp
@@ -0,0 +1,12 @@
+# manifests/cron/linux.pp
+class puppet::cron::linux inherits puppet::linux {
+ include puppet::cron::base
+ case $puppet_config {
+ '': { $puppet_config = '/etc/puppet/puppet.conf' }
+ }
+ File['/etc/cron.d/puppetd.cron']{
+ source => undef,
+ content => "# run puppet
+0,30 * * * * root puppetd --onetime --no-daemonize --splay true --config=$puppet_config",
+ }
+}
diff --git a/manifests/cron/openbsd.pp b/manifests/cron/openbsd.pp
new file mode 100644
index 0000000..38b2a4a
--- /dev/null
+++ b/manifests/cron/openbsd.pp
@@ -0,0 +1,22 @@
+class puppet::cron::openbsd inherits puppet::openbsd {
+ include puppet::cron::base
+ case $puppet_config {
+ '': { $puppet_config = '/etc/puppet/puppet.conf' }
+ }
+ Openbsd::Add_to_rc_local['puppetd']{
+ ensure => 'absent',
+ }
+ Cron['puppetd_check']{
+ ensure => absent,
+ }
+ Cron['puppetd_check']{
+ ensure => absent,
+ }
+
+ cron { 'puppetd_restart':
+ command => "puppetd --onetime --no-daemonize --splay true --config=$puppet_config",
+ user => 'root',
+ minute => [0,30],
+ }
+
+}