Puppet Class: dumps::web::fetches::kiwix

Defined in:
modules/dumps/manifests/web/fetches/kiwix.pp

Overview

Parameters:

  • user (Any) (defaults to: undef)
  • group (Any) (defaults to: undef)
  • xmldumpsdir (Any) (defaults to: undef)
  • miscdatasetsdir (Any) (defaults to: undef)


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
33
# File 'modules/dumps/manifests/web/fetches/kiwix.pp', line 1

class dumps::web::fetches::kiwix(
    $user = undef,
    $group = undef,
    $xmldumpsdir = undef,
    $miscdatasetsdir = undef,
) {
    require_package('rsync')

    file { "${xmldumpsdir}/kiwix":
        ensure => 'link',
        target => "${miscdatasetsdir}/kiwix",
        owner  => $user,
        group  => $group,
        mode   => '0644',
    }

    file { '/usr/local/bin/kiwix-rsync-cron.sh':
        mode   => '0755',
        owner  => 'root',
        group  => 'root',
        source => 'puppet:///modules/dumps/fetches/kiwix-rsync-cron.sh',
    }

    cron { 'kiwix-mirror-update':
        ensure      => 'present',
        environment => 'MAILTO=ops-dumps@wikimedia.org',
        command     => "/bin/bash /usr/local/bin/kiwix-rsync-cron.sh ${miscdatasetsdir}",
        user        => $user,
        minute      => '15',
        hour        => '*/2',
        require     => File['/usr/local/bin/kiwix-rsync-cron.sh'],
    }
}