]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blame - modules/base_installation/manifests/cronie.pp
Fix package dependencies for base installation
[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,
27 jobs => [
28 {
29 command => "cd $base_installation::puppet_code_path ; /usr/local/sbin/puppet_apply $base_installation::puppet_code_path/manifests/site.pp",
30 user => root,
31 minute => '*/20',
32 description => "Re-apply puppet changes regularly",
33 },
34 {
35 command => "cd $base_installation::puppet_code_path ; /usr/local/sbin/puppet_apply $base_installation::puppet_code_path/manifests/site.pp",
36 user => root,
37 special => "reboot",
38 description => "Re-apply puppet changes at reboot",
39 }
40 ]
503e4cf5 41 }
2859008e
IB
42
43 cron::daily { 'pacman_keys':
44 ensure => present,
45 command => "pacman-key --populate archlinux",
46 user => root,
47 minute => "0",
48 hour => "1",
49 description => "Populate pacman keys",
c443842e 50 }
7fed35a4
IB
51 }
52}