Puppet Class: profile::mirrors::tails

Defined in:
modules/profile/manifests/mirrors/tails.pp

Overview



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
46
47
# File 'modules/profile/manifests/mirrors/tails.pp', line 16

class profile::mirrors::tails {
    include profile::mirrors

    $local_dir = '/srv/mirrors/tails'
    $remote_path = 'mirrors.rsync.tails.boum.org::amnesia-archive/tails/'

    file { $local_dir:
        ensure => directory,
        owner  => 'mirror',
        group  => 'mirror',
        mode   => '0755',
    }

    $rsync_cmd = "/usr/bin/rsync -rt --delete ${remote_path} ${local_dir}"

    systemd::timer::job { 'update-tails-mirror':
        ensure      => 'present',
        user        => 'mirror',
        description => 'update the tails mirror with rsync',
        command     => $rsync_cmd,
        interval    => {'start' => 'OnUnitInactiveSec', 'interval' => '1h'},
    }

    # serve via rsync
    rsync::server::module { 'tails':
        path      => $local_dir,
        read_only => 'yes',
        uid       => 'nobody',
        gid       => 'nogroup',
    }

}