No bind address also listens on v6
[mirror/dsa-puppet.git] / modules / buildd / manifests / init.pp
1 class buildd ($ensure=present) {
2
3         include schroot
4
5         package { 'sbuild':
6                 ensure => installed,
7                 tag    => extra_repo,
8         }
9         package { 'libsbuild-perl':
10                 ensure => installed,
11                 tag    => extra_repo,
12                 before => Package['sbuild']
13         }
14
15         package { 'apt-transport-https':
16                 ensure => installed,
17         }
18         if $ensure == present {
19                 package { 'dupload':
20                         ensure => installed,
21                 }
22                 file { '/etc/dupload.conf':
23                         source  => 'puppet:///modules/buildd/dupload.conf',
24                         require => Package['dupload'],
25                 }
26                 site::linux_module { 'dm_snapshot': }
27                 ferm::module { 'nf_conntrack_ftp': }
28         }
29
30         site::aptrepo { 'buildd':
31                 ensure => absent,
32         }
33
34         $suite = $::lsbdistcodename ? {
35                 squeeze => $::lsbdistcodename,
36                 wheezy  => $::lsbdistcodename,
37                 undef   => 'squeeze',
38                 default => 'wheezy'
39         }
40
41         site::aptrepo { 'buildd.debian.org':
42                 key        => 'puppet:///modules/buildd/buildd.debian.org.asc',
43                 url        => 'https://buildd.debian.org/apt/',
44                 suite      => $suite,
45                 components => 'main',
46                 require    => Package['apt-transport-https'],
47         }
48
49         site::aptrepo { 'buildd.debian.org-proposed':
50                 ensure     => $::hostname ? {
51                                              /^(alkman|barber|brahms|porpora|zandonai)$/ => 'present',
52                                              default => 'absent',
53                                             },
54                 url        => 'https://buildd.debian.org/apt/',
55                 suite      => "${suite}-proposed",
56                 components => 'main',
57                 require    => Package['apt-transport-https'],
58         }
59
60         #site::aptrepo { 'buildd.debian.org-experimental':
61         #       ensure     => $::hostname ? {
62         #                                    /^(xxxx)$/ => 'present',
63         #                                    default => 'absent',
64         #                                   },
65         #       url        => 'https://buildd.debian.org/apt/',
66         #       suite      => "${suite}-experimental",
67         #       components => 'main',
68         #       require    => Package['apt-transport-https'],
69         #}
70
71         # 'bad' extension
72         file { '/etc/apt/preferences.d/buildd.debian.org':
73                 ensure => absent,
74         }
75         file { '/etc/apt/preferences.d/buildd':
76                 ensure => absent,
77         }
78         file { '/etc/cron.d/dsa-buildd':
79                 source  => 'puppet:///modules/buildd/cron.d-dsa-buildd',
80                 require => Package['debian.org']
81         }
82
83         if ($::lsbmajdistrelease >= 7 and $::kernel == 'Linux') {
84                 package { 'python-psutil':
85                         ensure => installed,
86                 }
87                 file { '/usr/local/sbin/buildd-schroot-aptitude-kill':
88                         source  => 'puppet:///modules/buildd/buildd-schroot-aptitude-kill',
89                         mode    => '0555',
90                 }
91         } else {
92                 file { '/usr/local/sbin/buildd-schroot-aptitude-kill':
93                         source  => 'puppet:///modules/buildd/buildd-schroot-aptitude-kill.squeeze',
94                         mode    => '0555',
95                 }
96         }
97         file { '/etc/cron.d/puppet-buildd-aptitude':
98                 content => "*/5 * * * * root /usr/local/sbin/buildd-schroot-aptitude-kill\n",
99         }
100 }