export staticsync ssh keys, but do not yet collect
[mirror/dsa-puppet.git] / modules / roles / manifests / static_master.pp
1 # static master
2 #
3 # each component defines exactly one static master.  Content is copied from the source host
4 # to the master, and from there to all the mirrors.
5 #
6 class roles::static_master {
7   include roles::static_base
8   include roles::static_srvdir
9
10   file { '/usr/local/bin/static-master-run':
11     source => 'puppet:///modules/roles/static-mirroring/static-master-run',
12     mode   => '0555',
13   }
14   file { '/usr/local/bin/static-master-update-component':
15     source => 'puppet:///modules/roles/static-mirroring/static-master-update-component',
16     mode   => '0555',
17   }
18   file { '/etc/static-clients.conf':
19     content => template('roles/static-mirroring/static-clients.conf.erb'),
20   }
21
22   file { '/home/staticsync/static-master':
23     ensure => link,
24     target => '/srv/static.debian.org',
25   }
26   file { '/srv/static.debian.org/master':
27     ensure => directory,
28     mode   => '0755',
29     owner  => 'staticsync',
30     group  => 'staticsync',
31   }
32
33   # export some information for the onion.debian.org build
34   if $::hostname in [dillon] {
35     file { '/srv/puppet.debian.org':
36       ensure => directory
37     }
38     file { '/srv/puppet.debian.org/puppet-facts':
39       ensure => directory
40     }
41     concat { '/srv/puppet.debian.org/puppet-facts/onionbalance-services.yaml':
42       notify  => Exec['rebuild-onion-website'],
43     }
44     Concat::Fragment <<| tag == 'onionbalance-services.yaml' |>>
45
46     exec { 'rebuild-onion-website':
47       command => '/bin/su - staticsync -c \'make -C /srv/onion-master.debian.org\'',
48       refreshonly => true,
49     }
50   }
51 }