]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - modules/base_installation/manifests/cronie.pp
Refactor base installation module
[perso/Immae/Projets/Puppet.git] / modules / base_installation / manifests / cronie.pp
diff --git a/modules/base_installation/manifests/cronie.pp b/modules/base_installation/manifests/cronie.pp
new file mode 100644 (file)
index 0000000..bcdd9a7
--- /dev/null
@@ -0,0 +1,21 @@
+class base_installation::cronie inherits base_installation {
+  ensure_packages(['cronie'])
+
+  unless empty($base_installation::puppet_code_path) {
+    file { 'post-hook':
+      ensure  => file,
+      path    => "$base_installation::puppet_code_path/.git/hooks/post-merge",
+      source  => 'puppet:///modules/base_installation/cronie/puppet-post-merge',
+      mode    => '0755',
+      owner   => root,
+      group   => root,
+    }
+    cron { 'puppet-apply':
+      ensure  => present,
+      command => "cd $base_installation::puppet_code_path ; /usr/bin/git pull",
+      user    => root,
+      minute  => '*/30',
+      require => File['post-hook'],
+    }
+  }
+}