X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fbase_installation%2Fmanifests%2Fcronie.pp;h=ca3eb2a4548193e9a8c1e0b611690cef6a98aa15;hb=220496056eb730f204f9d21d61d10d41d876c5a1;hp=e8f3e20eb456d8d87257812879d4f07897f02796;hpb=cfa8eb925ff0115d5d4b2298f7d9a054b869fa75;p=perso%2FImmae%2FProjets%2FPuppet.git diff --git a/modules/base_installation/manifests/cronie.pp b/modules/base_installation/manifests/cronie.pp index e8f3e20..ca3eb2a 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,31 +14,39 @@ 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 { 'puppet-apply': - ensure => present, - command => "cd $base_installation::puppet_code_path ; puppet_apply $base_installation::puppet_code_path/manifests/site.pp", - user => root, - minute => '*/20' + cron::job { 'puppet-pull-apply': + ensure => present, + 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 { 'puppet-apply-reboot': - ensure => present, - command => "cd $base_installation::puppet_code_path ; puppet_apply $base_installation::puppet_code_path/manifests/site.pp", - user => root, - special => "reboot" + cron::job::multiple { 'puppet-apply': + ensure => present, + 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 { 'pacman_keys': - ensure => present, - command => "pacman-key --populate archlinux", - user => root, - minute => "0", - hour => "1", + + cron::daily { 'pacman_keys': + ensure => present, + command => "pacman-key --populate archlinux", + user => root, + minute => "0", + hour => "1", + description => "Populate pacman keys", } } }