Puppet Class: reportupdater
- Defined in:
- modules/reportupdater/manifests/init.pp
Overview
Class reportupdater
Sets up repositories and rsync for using reportupdater. See: wikitech.wikimedia.org/wiki/Analytics/Reportupdater
Parameters
$user - string. User for cloning repositories and
folder permits.
$base_path - string. Base path where to put all reportupdater's
necessary files: source code, output, logs and jobs.
Default: /srv/reportupdater
$log_path - string. Path where to put reportupdater's logs.
Default: ${base_path}/log
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'modules/reportupdater/manifests/init.pp', line 17
class reportupdater(
$user,
$base_path = '/srv/reportupdater',
$log_path = undef,
) {
$group = 'wikidev'
# Path at which reportupdater source will be cloned.
$source_path = "${base_path}/reportupdater"
# Path in which all reportupdater output will be stored.
$output_path = "${base_path}/output"
# Path in which all reportupdater jobs will log.
if $log_path == undef {
$log_path = "${base_path}/log"
}
# Path in which individual reportupdater job repositories
# will be cloned.
$jobs_path = "${base_path}/jobs"
# Ensure these directories exist and are writeable by $user.
file { [$base_path, $output_path, $log_path, $jobs_path]:
ensure => 'directory',
owner => $user,
group => $group,
mode => '0775',
}
# Add logrotate for $log_path/*.log.
logrotate::conf { 'reportupdater':
content => template('reportupdater/logrotate.erb'),
require => File[$log_path],
}
package { 'python3-pid':
ensure => 'installed'
}
# Ensure reportupdater is cloned and latest version.
git::clone { 'analytics/reportupdater':
ensure => 'latest',
directory => $source_path,
origin => 'https://gerrit.wikimedia.org/r/analytics/reportupdater.git',
owner => $user,
require => [File[$base_path], Package['python3-pid']]
}
}
|