Puppet Class: cron::purge

Defined in:
manifests/purge.pp

Overview

This is where all the purging magic happens. Purge unmanaged cron jobs and also, optionally, purge /etc/cron.d directory.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'manifests/purge.pp', line 5

class cron::purge {
  $noop = if $cron::purge_noop { true } else { undef }

  if $cron::purge_cron and $cron::allow_all_users {
    notify { 'purge_users_crontabs':
      message => "WARNING! Users' crontabs will be purged. Disable purge_cron or allow_all_users.",
    }
  }

  if $cron::purge_cron {
    resources { 'cron':
      purge => true,
      noop  => $noop,
    }
  }

  if $cron::purge_crond {
    file { '/etc/cron.d':
      ensure  => directory,
      owner   => 'root',
      group   => 'root',
      mode    => '0755',
      recurse => true,
      purge   => true,
      force   => true,
      noop    => $noop,
    }
  }
}