X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fbase_installation%2Fmanifests%2Fcronie.pp;h=923e181d61d315e9c86e824225184848a38155a3;hb=0f3b69eb188346cb657850ea218918bd4a43460d;hp=918bce3373af309300c3d62de427fa929a97e33b;hpb=503e4cf5c54e3fe4b802038e8917341c4ce803e5;p=perso%2FImmae%2FProjets%2FPuppet.git diff --git a/modules/base_installation/manifests/cronie.pp b/modules/base_installation/manifests/cronie.pp index 918bce3..923e181 100644 --- a/modules/base_installation/manifests/cronie.pp +++ b/modules/base_installation/manifests/cronie.pp @@ -1,6 +1,10 @@ class base_installation::cronie inherits base_installation { ensure_packages(['cronie']) + Package["cronie"] -> Cron::Job <| |> + Package["cronie"] -> Cron::Job::Multiple <| |> + Package["cronie"] -> Cron::Daily <| |> + unless empty($base_installation::puppet_code_path) { file { 'post-hook': ensure => file, @@ -10,18 +14,41 @@ class base_installation::cronie inherits base_installation { owner => root, group => root, } - cron { 'puppet-pull-apply': - ensure => present, - command => "cd $base_installation::puppet_code_path ; /usr/bin/git pull", - user => root, - minute => '*/30', - require => File['post-hook'], + cron::job { 'puppet-pull-apply': + ensure => present, + environment => [ 'MAILTO=""' ], + command => "cd $base_installation::puppet_code_path ; /usr/bin/git pull", + user => root, + minute => '15,45', + require => File['post-hook'], + description => "Pull git and apply puppet changes", + } + cron::job::multiple { 'puppet-apply': + ensure => present, + environment => [ 'MAILTO=""' ], + jobs => [ + { + command => "cd $base_installation::puppet_code_path ; /usr/local/sbin/puppet_apply $base_installation::puppet_code_path/manifests/site.pp", + user => root, + minute => '*/20', + description => "Re-apply puppet changes regularly", + }, + { + command => "cd $base_installation::puppet_code_path ; /usr/local/sbin/puppet_apply $base_installation::puppet_code_path/manifests/site.pp", + user => root, + special => "reboot", + description => "Re-apply puppet changes at reboot", + } + ] } - cron { 'puppet-apply': - ensure => present, - command => "cd $base_installation::puppet_code_path ; puppet apply --test $base_installation::puppet_code_path/manifests/site.pp", - user => root, - minute => '*/20' + + cron::daily { 'pacman_keys': + ensure => present, + command => "pacman-key --populate archlinux", + user => root, + minute => "0", + hour => "1", + description => "Populate pacman keys", } } }