create ~staticsync/static-master -> /srv/static.debian.org on static-masters
[mirror/dsa-puppet.git] / modules / roles / manifests / static_master.pp
1 class roles::static_master {
2         include roles::static_base
3         include roles::static_srvdir
4
5         file { '/usr/local/bin/static-master-run':
6                 source => 'puppet:///modules/roles/static-mirroring/static-master-run',
7                 mode   => '0555',
8         }
9         file { '/usr/local/bin/static-master-update-component':
10                 source => 'puppet:///modules/roles/static-mirroring/static-master-update-component',
11                 mode   => '0555',
12         }
13         file { '/etc/static-clients.conf':
14                 content => template('roles/static-mirroring/static-clients.conf.erb'),
15         }
16
17         file { "/home/staticsync/static-master":
18                 ensure => link,
19                 target => '/srv/static.debian.org',
20         }
21
22         # export some information for the onion.debian.org build
23         if $::hostname in [dillon] {
24                 file { '/srv/puppet.debian.org':
25                         ensure => directory
26                 }
27                 file { '/srv/puppet.debian.org/puppet-facts':
28                         ensure => directory
29                 }
30                 concat { '/srv/puppet.debian.org/puppet-facts/onionbalance-services.yaml':
31                         notify  => Exec["rebuild-onion-website"],
32                 }
33                 Concat::Fragment <<| tag == "onionbalance-services.yaml" |>>
34
35                 exec { 'rebuild-onion-website':
36                         command => '/bin/su - staticsync -c \'make -C /srv/onion-master.debian.org\'',
37                         refreshonly => true,
38                 }
39         }
40 }