aboutsummaryrefslogtreecommitdiff
path: root/modules/base_installation/manifests/cronie.pp
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-03-26 00:41:55 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-03-26 01:19:39 +0200
commit2859008efe8f0a75344c7ba1c9c6e4d589f92da3 (patch)
treebb48fa503b6b1e01f9216d9e1729e1ba26adacf5 /modules/base_installation/manifests/cronie.pp
parent7f1244c8c2a418ed9e978f098c73f8697e2cd306 (diff)
downloadPuppet-2859008efe8f0a75344c7ba1c9c6e4d589f92da3.tar.gz
Puppet-2859008efe8f0a75344c7ba1c9c6e4d589f92da3.tar.zst
Puppet-2859008efe8f0a75344c7ba1c9c6e4d589f92da3.zip
Use external module for cronjobs
Diffstat (limited to 'modules/base_installation/manifests/cronie.pp')
-rw-r--r--modules/base_installation/manifests/cronie.pp54
1 files changed, 31 insertions, 23 deletions
diff --git a/modules/base_installation/manifests/cronie.pp b/modules/base_installation/manifests/cronie.pp
index 2235470..3558d9f 100644
--- a/modules/base_installation/manifests/cronie.pp
+++ b/modules/base_installation/manifests/cronie.pp
@@ -10,31 +10,39 @@ class base_installation::cronie inherits base_installation {
10 owner => root, 10 owner => root,
11 group => root, 11 group => root,
12 } 12 }
13 cron { 'puppet-pull-apply': 13 cron::job { 'puppet-pull-apply':
14 ensure => present, 14 ensure => present,
15 command => "cd $base_installation::puppet_code_path ; /usr/bin/git pull", 15 command => "cd $base_installation::puppet_code_path ; /usr/bin/git pull",
16 user => root, 16 user => root,
17 minute => '*/30', 17 minute => '15,45',
18 require => File['post-hook'], 18 require => File['post-hook'],
19 description => "Pull git and apply puppet changes",
19 } 20 }
20 cron { 'puppet-apply': 21 cron::job::multiple { 'puppet-apply':
21 ensure => present, 22 ensure => present,
22 command => "cd $base_installation::puppet_code_path ; /usr/local/sbin/puppet_apply $base_installation::puppet_code_path/manifests/site.pp", 23 jobs => [
23 user => root, 24 {
24 minute => '*/20' 25 command => "cd $base_installation::puppet_code_path ; /usr/local/sbin/puppet_apply $base_installation::puppet_code_path/manifests/site.pp",
26 user => root,
27 minute => '*/20',
28 description => "Re-apply puppet changes regularly",
29 },
30 {
31 command => "cd $base_installation::puppet_code_path ; /usr/local/sbin/puppet_apply $base_installation::puppet_code_path/manifests/site.pp",
32 user => root,
33 special => "reboot",
34 description => "Re-apply puppet changes at reboot",
35 }
36 ]
25 } 37 }
26 cron { 'puppet-apply-reboot': 38
27 ensure => present, 39 cron::daily { 'pacman_keys':
28 command => "cd $base_installation::puppet_code_path ; /usr/local/sbin/puppet_apply $base_installation::puppet_code_path/manifests/site.pp", 40 ensure => present,
29 user => root, 41 command => "pacman-key --populate archlinux",
30 special => "reboot" 42 user => root,
31 } 43 minute => "0",
32 cron { 'pacman_keys': 44 hour => "1",
33 ensure => present, 45 description => "Populate pacman keys",
34 command => "pacman-key --populate archlinux",
35 user => root,
36 minute => "0",
37 hour => "1",
38 } 46 }
39 } 47 }
40} 48}