summaryrefslogtreecommitdiff
path: root/manifests/instance.pp
blob: 014872814f9e1a1c33c1c84f511717d6d72e6cbc (plain)
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
define domain_check::instance(
  $interval = '60',
  $email    = 'root',
  $hour     = '0',
  $minute   = '0',
  $weekday  = '0',
  $file     = false,
  $ensure   = present
) {
  $cert_check = "/usr/local/bin/domain-check -a -q -x ${interval} -e ${email}"

  case $file {
    true: {
      $command = "$cert_check -f ${file}"
    }
    false, default: {
      $command = "$cert_check -d ${name}"
    }
  }

  cron { "domain-check-${name}":
    command  => "$command >/dev/null 2>&1",
    user     => root,
    hour     => $hour,
    minute   => $minute,
    weekday  => $weekday,
    ensure   => $ensure,
    require  => File["/usr/local/bin/domain-check"],
  }
}