summaryrefslogtreecommitdiffstats
path: root/modules/cron/manifests/init.pp
blob: d715a862d2e8238bb9c450e17906ff88175c3cdd (plain) (blame)
1
2
3
4
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
class cron {
  include godwrap

  $from = "${facts['networking']['hostname']}-cron"
  $password = secret::value('cron_email_password')

  package { ["cronie", "msmtp"]:
    ensure => installed,
  }

  file {
    '/etc/msmtprc':
      content => template('cron/msmtprc');
    '/etc/aliases':
      content => template('cron/aliases');
    "/etc/cronjobs":
      ensure => directory,
      recurse => true,
      purge => true;
  }

  systemd::override { "cronie":
    source => 'puppet:///modules/cron/override.conf';
  }

  service { 'cronie':
    ensure => running,
    enable => true,
    subscribe => Systemd::Override['cronie'],
    require => Package['cronie'];
  }
}