]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blame - modules/base_installation/manifests/cronie.pp
Disable e-mails for puppet apply
[perso/Immae/Projets/Puppet.git] / modules / base_installation / manifests / cronie.pp
CommitLineData
7fed35a4
IB
1class base_installation::cronie inherits base_installation {
2 ensure_packages(['cronie'])
3
22049605
IB
4 Package["cronie"] -> Cron::Job <| |>
5 Package["cronie"] -> Cron::Job::Multiple <| |>
6 Package["cronie"] -> Cron::Daily <| |>
7
7fed35a4
IB
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 }
2859008e
IB
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",
7fed35a4 24 }
2859008e
IB
25 cron::job::multiple { 'puppet-apply':
26 ensure => present,
60bb95a8 27 environment => [ 'MAILTO=""' ],
2859008e
IB
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 ]
503e4cf5 42 }
2859008e
IB
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",
c443842e 51 }
7fed35a4
IB
52 }
53}