Puppet Class: geoip::systemd::timer

Defined in:
manifests/systemd/timer.pp

Summary

Controll the SystemD Timer unit

Overview

This class will create a SystemD timer unit triggering the update service on each wallclock timer.

Parameters:

  • overwrite_wallclocks (Boolean) (defaults to: true)

    if systemd_config is set to dropin, the existing timer may already have wallclocks, this aboud to overwrite or append them



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
34
35
36
37
38
39
40
41
42
43
44
45
# File 'manifests/systemd/timer.pp', line 8

class geoip::systemd::timer (
  Boolean $overwrite_wallclocks = true,
) {
  if $geoip::systemd_config == 'unit' {
    if $geoip::update_timers.length > 0 {
      systemd::unit_file { "${geoip::service_name}.timer":
        ensure  => $geoip::ensure,
        content => epp('geoip/timer_unit.epp'),
      }
      ~> service { "${geoip::service_name}.timer":
        ensure => 'running',
        enable => true,
      }
    } else {
      service { "${geoip::service_name}.timer":
        ensure => 'stopped',
        enable => false,
      }
    }
  } elsif $geoip::systemd_config == 'dropin' {
    systemd::dropin_file { '10-head.conf':
      unit    => "${geoip::service_name}.timer",
      content => epp('geoip/timer_dropin_10.epp'),
    }
    if $overwrite_wallclocks {
      systemd::dropin_file { '20-clearclocks.conf':
        unit    => "${geoip::service_name}.timer",
        content => epp('geoip/timer_dropin_20.epp'),
      }
    }
    if $geoip::update_timers.length > 0 {
      systemd::dropin_file { '30-wallclocks.conf':
        unit    => "${geoip::service_name}.timer",
        content => epp('geoip/timer_dropin_30.epp'),
      }
    }
  }
}