whitespace/quoting: modules/staticsync/manifests/static_mirror.pp (make lint happy)
[mirror/dsa-puppet.git] / modules / staticsync / manifests / static_mirror.pp
1 # a static mirror.  It will get content for all components that it servers
2 # from each component's master.
3 #
4 # Static mirrors register themselves via a stored-conf /etc/static-clients.conf
5 # that the masters collect.  Mirrors can always pull, but they only get
6 # triggered if they are in /etc/static-clients.conf.  So during initial
7 # setup it might make sense to not get triggered and thus block updates of
8 # components until all mirrors are in sync; set $get_triggered = false for that.
9 #
10 class staticsync::static_mirror (
11   Boolean $get_triggered = true,
12 ) {
13   include staticsync::base
14   include staticsync::srvdir
15
16   # mirrors talk only to masters
17   class { 'staticsync::ssh':
18     add_tag     => 'staticsync-master',
19     collect_tag => 'staticsync-mirror',
20   }
21
22   file { '/usr/local/bin/static-mirror-run':
23     source => 'puppet:///modules/staticsync/static-mirror-run',
24     mode   => '0555',
25   }
26   file { '/usr/local/bin/static-mirror-run-all':
27     source => 'puppet:///modules/staticsync/static-mirror-run-all',
28     mode   => '0555',
29   }
30   file { '/etc/cron.d/puppet-static-mirror': ensure => absent, }
31   concat::fragment { 'puppet-crontab--static-mirror':
32     target  => '/etc/cron.d/puppet-crontab',
33     content => @("EOF"),
34         @reboot ${staticsync::user} sleep 60; chronic static-mirror-run-all
35         | EOF
36   }
37
38   if $get_triggered {
39     @@concat::fragment { "static-client-${::fqdn}":
40       tag     => 'staticsync::static-mirrors-to-trigger',
41       content => $::fqdn,
42       target  => '/etc/static-clients.conf',
43     }
44   }
45 }