]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blame - modules/base_installation/manifests/cronie.pp
Disable mailto for all 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,
0f3b69eb 19 environment => [ 'MAILTO=""' ],
2859008e
IB
20 command => "cd $base_installation::puppet_code_path ; /usr/bin/git pull",
21 user => root,
22 minute => '15,45',
23 require => File['post-hook'],
24 description => "Pull git and apply puppet changes",
7fed35a4 25 }
2859008e
IB
26 cron::job::multiple { 'puppet-apply':
27 ensure => present,
60bb95a8 28 environment => [ 'MAILTO=""' ],
2859008e
IB
29 jobs => [
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 minute => '*/20',
34 description => "Re-apply puppet changes regularly",
35 },
36 {
37 command => "cd $base_installation::puppet_code_path ; /usr/local/sbin/puppet_apply $base_installation::puppet_code_path/manifests/site.pp",
38 user => root,
39 special => "reboot",
40 description => "Re-apply puppet changes at reboot",
41 }
42 ]
503e4cf5 43 }
2859008e
IB
44
45 cron::daily { 'pacman_keys':
46 ensure => present,
47 command => "pacman-key --populate archlinux",
48 user => root,
49 minute => "0",
50 hour => "1",
51 description => "Populate pacman keys",
c443842e 52 }
7fed35a4
IB
53 }
54}