8c66303eeff1b0e6306a2ab51210f57e107ba8b5
[mirror/dsa-puppet.git] / modules / roles / manifests / static / base.pp
1 # the base class defining tings common for all three static classes (master, mirror, source)
2 class roles::static::base {
3   file { '/etc/static-components.conf':
4     content => template('roles/static-mirroring/static-components.conf.erb'),
5   }
6
7   file { '/usr/local/bin/staticsync-ssh-wrap':
8     source => 'puppet:///modules/roles/static-mirroring/staticsync-ssh-wrap',
9     mode   => '0555',
10   }
11
12   file { '/usr/local/bin/static-update-component':
13     source => 'puppet:///modules/roles/static-mirroring/static-update-component',
14     mode    => '0555',
15   }
16
17   file { '/usr/local/bin/static-mirror-ssh-wrap': ensure => absent; }
18   file { '/usr/local/bin/static-master-ssh-wrap': ensure => absent; }
19
20   ferm::rule { 'dsa-static-bt-v4':
21     description => 'Allow bt between static hosts',
22     rule        => 'proto tcp mod state state (NEW) mod multiport destination-ports (6881:6999) @subchain \'static-bt\' { saddr ($HOST_STATIC_V4) ACCEPT; }',
23     notarule    => true,
24   }
25   ferm::rule { 'dsa-static-bt-v6':
26     description => 'Allow bt between static hosts',
27     domain      => 'ip6',
28     rule        => 'proto tcp mod state state (NEW) mod multiport destination-ports (6881:6999) @subchain \'static-bt\' { saddr ($HOST_STATIC_V6) ACCEPT; }',
29     notarule    => true,
30   }
31
32   file { '/etc/staticsync.conf':
33     content  => @("EOF"),
34                 # This file is sourced by bash
35                 # and parsed by python
36                 #  - empty lines and lines starting with a # are ignored.
37                 #  - other lines are key=value.  No extra spaces anywhere.  No quoting.
38                 base=/srv/static.debian.org
39                 masterbase=/home/staticsync/static-master/master
40                 staticuser=staticsync
41                 | EOF
42   }
43 }