Defined Type: profile::docker::reporter::report

Defined in:
modules/profile/manifests/docker/reporter/report.pp

Overview

Parameters:

  • frequency (Enum['daily', 'weekly'])
  • proxy (String)


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
# File 'modules/profile/manifests/docker/reporter/report.pp', line 1

define profile::docker::reporter::report(
    Enum['daily', 'weekly'] $frequency,
    String $proxy
) {
    file { "/etc/docker-report/${title}_rules.ini":
        ensure => present,
        owner  => 'root',
        group  => 'root',
        source => "puppet:///modules/profile/docker/reporter/${title}_rules.ini",
    }
    $hour = sprintf('%02d', fqdn_rand(24, $title))
    $interval = $frequency ? {
        'daily' => "*-*-* ${hour}:00:00",
        'weekly' => "Mon *-*-* ${hour}:00:00"
    }
    systemd::timer::job { "docker-reporter-${title}-images":
        description        => "Report on upgrades to ${title} images.",
        command            => "/usr/bin/docker-report --filter-file /etc/docker-report/${title}_rules.ini docker-registry.wikimedia.org",
        interval           => {'start' => 'OnCalendar', 'interval' => $interval},
        user               => 'root',
        environment        => {'http_proxy' => $proxy},
        syslog_identifier  => "docker-report-${title}",
        # TODO: enable monitoring
        monitoring_enabled => false,

    }
}