howto/static-mirroring: static_mirror_nopush -> get_triggered:false
[mirror/dsa-wiki.git] / input / howto / static-mirroring.creole
1 = static mirroring
2
3 The static mirroring system mirrors //components//, i.e. directory trees from
4 their individual //source// hosts via //static-master// hosts to the
5 //static-mirrors//.
6
7 The static-master can be configured per source.  The mirrors are the same set
8 for all components.
9
10 == Adding a new static component
11
12 Using already configured source and master hosts.
13
14 * Pick a component name, e.g., {{{debaday.debian.net}}}
15
16 * Pick/Learn source host, pick a master, and add to {{{dsa-puppet/modules/roles/misc/static-components.yaml}}}:
17 {{{
18        debaday.debian.net:
19          master: static-master-manda-01.debian.org
20          source: dillon.debian.org:/srv/debaday.debian.net/htdocs
21 }}}
22
23 * Give sudo to run the right {{{static-update-component}}} to the appropriate group:
24 {{{
25         /usr/sbin/visudo -f dsa-puppet/modules/sudo/files/sudoers
26 }}}
27 and add something like
28 {{{
29         lucas           dillon=(staticsync)             NOPASSWD: /usr/local/bin/static-update-component debaday.debian.net
30 }}}
31
32 * Add the vhost config on mirrors:
33 ** vi {{{dsa-puppet/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb}}}
34 and add
35 <pre>
36   vhost(lines, "debaday.debian.net"            , :ssl => true
37 </pre>
38 and
39 <pre>
40   onion::service { 'debaday.debian.net'            : ensure => 'ifstatic', port => 80, target_port => 80, target_address => $onion_addr }
41 </pre>
42 ** In {{{dsa-puppet/modules/roles/manifests/static_mirror_web.pp}}}, add:
43 {{{
44         ssl::service { 'debaday.debian.net'            : ensure => 'ifstatic', notify  => Exec['service apache2 reload'], key => true, }
45 }}}
46
47 * run puppet on the master, the source, and all the mirrors.  Check {{{dsa-puppet/data/nodes/*.yaml}}}.
48
49 == Adding a mirror
50
51 Note:  This might temporarily break apache on the new mirror host.
52
53 * Add {{{roles::static_mirror}}} to the {{{classes}}} stanza in {{{data/nodes/$HOSTNAME.yaml}}}.
54 * Add {{{staticsync::static_mirror::get_triggered: false}}} to {{{data/nodes/$HOSTNAME.yaml}}}.
55 * Add {{{staticsync}}} group to host's {{{allowedGroups}}} attribute in ldap.
56 * Run puppet twice on new static mirror once staticsync exists.
57 * Run puppet on static masters.
58 * On the static mirror: {{{install -d -o staticsync -g staticsync -m 02755 /srv/static.debian.org}}}.
59 * Run the command from {{{/etc/cron.d/puppet-static-mirror}}} on the mirror.
60 * Make sure apache works on the mirror.  This might require deploying SSL keys.
61 * Remove {{{staticsync::static_mirror::get_triggered: false}}} from {{{data/nodes/$HOSTNAME.yaml}}}.
62 * Run puppet on static masters.
63 * Rotate mirror.