]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blob - modules/base_installation/manifests/cronie.pp
7552b4dae4286ab30ba655918373f36431a319bd
[perso/Immae/Projets/Puppet.git] / modules / base_installation / manifests / cronie.pp
1 class base_installation::cronie inherits base_installation {
2 ensure_packages(['cronie'])
3
4 Package["cronie"] -> Cron::Job <| |>
5 Package["cronie"] -> Cron::Job::Multiple <| |>
6 Package["cronie"] -> Cron::Daily <| |>
7
8 unless empty($base_installation::puppet_code_path) {
9 file { 'post-hook':
10 ensure => file,
11 path => "$base_installation::puppet_code_path/.git/hooks/post-merge",
12 source => 'puppet:///modules/base_installation/cronie/puppet-post-merge',
13 mode => '0755',
14 owner => root,
15 group => root,
16 }
17 cron::job { 'puppet-pull-apply':
18 ensure => present,
19 command => "cd $base_installation::puppet_code_path ; /usr/bin/git pull",
20 user => root,
21 minute => '15,45',
22 require => File['post-hook'],
23 description => "Pull git and apply puppet changes",
24 }
25 cron::job::multiple { 'puppet-apply':
26 ensure => present,
27 environment => [ 'MAILTO=""' ],
28 jobs => [
29 {
30 command => "cd $base_installation::puppet_code_path ; /usr/local/sbin/puppet_apply $base_installation::puppet_code_path/manifests/site.pp",
31 user => root,
32 minute => '*/20',
33 description => "Re-apply puppet changes regularly",
34 },
35 {
36 command => "cd $base_installation::puppet_code_path ; /usr/local/sbin/puppet_apply $base_installation::puppet_code_path/manifests/site.pp",
37 user => root,
38 special => "reboot",
39 description => "Re-apply puppet changes at reboot",
40 }
41 ]
42 }
43
44 cron::daily { 'pacman_keys':
45 ensure => present,
46 command => "pacman-key --populate archlinux",
47 user => root,
48 minute => "0",
49 hour => "1",
50 description => "Populate pacman keys",
51 }
52 }
53 }