1 class buildd ($ensure=present) {
9 package { 'libsbuild-perl':
12 before => Package['sbuild']
15 package { 'apt-transport-https':
18 if $ensure == present {
22 file { '/etc/dupload.conf':
23 source => 'puppet:///modules/buildd/dupload.conf',
24 require => Package['dupload'],
26 site::linux_module { 'dm_snapshot': }
27 include ferm::ftp_conntrack
30 site::aptrepo { 'buildd':
34 $suite = $::lsbdistcodename ? {
35 squeeze => $::lsbdistcodename,
36 wheezy => $::lsbdistcodename,
41 site::aptrepo { 'buildd.debian.org':
42 key => 'puppet:///modules/buildd/buildd.debian.org.gpg',
43 url => 'https://buildd.debian.org/apt/',
46 require => Package['apt-transport-https'],
49 $buildd_prop_ensure = $::hostname ? {
50 /^(alkman|brahms|porpora|zandonai)$/ => 'present',
54 if ($::lsbmajdistrelease >= 8) {
55 file { '/etc/apt/apt.conf.d/puppet-https-buildd':
56 content => "Acquire::https::buildd.debian.org::CaInfo \"/etc/ssl/ca-debian/ca-certificates.crt\";\n",
59 file { '/etc/apt/apt.conf.d/puppet-https-buildd':
60 content => "Acquire::https::buildd.debian.org::CaInfo \"/etc/ssl/servicecerts/buildd.debian.org.crt\";\n",
63 site::aptrepo { 'buildd.debian.org-proposed':
64 ensure => $buildd_prop_ensure,
65 url => 'https://buildd.debian.org/apt/',
66 suite => "${suite}-proposed",
68 require => [ Package['apt-transport-https'],
69 File['/etc/apt/apt.conf.d/puppet-https-buildd'] ],
73 file { '/etc/apt/preferences.d/buildd.debian.org':
76 file { '/etc/apt/preferences.d/buildd':
79 file { '/etc/cron.d/dsa-buildd':
80 source => 'puppet:///modules/buildd/cron.d-dsa-buildd',
81 require => Package['debian.org']
84 if ($::lsbmajdistrelease >= 7 and $::kernel == 'Linux') {
85 package { 'python-psutil':
88 if ($::lsbmajdistrelease >= 8) {
89 file { '/usr/local/sbin/buildd-schroot-aptitude-kill':
90 source => 'puppet:///modules/buildd/buildd-schroot-aptitude-kill',
94 file { '/usr/local/sbin/buildd-schroot-aptitude-kill':
95 source => 'puppet:///modules/buildd/buildd-schroot-aptitude-kill.wheezy',
100 file { '/usr/local/sbin/buildd-schroot-aptitude-kill':
101 source => 'puppet:///modules/buildd/buildd-schroot-aptitude-kill.squeeze',
105 file { '/etc/cron.d/puppet-buildd-aptitude':
106 content => "*/5 * * * * root /usr/local/sbin/buildd-schroot-aptitude-kill\n",
110 file { '/etc/cron.d/puppet-update-buildd-schroots':
111 content => "13 21 * * 0 root PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin setup-all-dchroots buildd\n",
115 file { '/home/buildd':
121 file { '/home/buildd/build':
127 file { '/home/buildd/logs':
133 file { '/home/buildd/old-logs':
139 file { '/home/buildd/upload-security':
145 file { '/home/buildd/stats':
151 file { '/home/buildd/stats/graphs':
157 file { '/home/buildd/upload':
163 file { '/home/buildd/.forward':
164 content => "|/usr/bin/buildd-mail\n",
170 exec { 'create-buildd-key':
171 command => '/bin/su - buildd -c \'mkdir -p -m 02700 .ssh && ssh-keygen -C "`whoami`@`hostname` (`date +%Y-%m-%d`)" -P "" -f .ssh/id_rsa -q\'',
172 onlyif => '/usr/bin/getent passwd buildd > /dev/null && ! [ -e /home/buildd/.ssh/id_rsa ]'
177 if $::buildd_user_exists {
178 exec { 'add-buildd-user-to-sbuild':
179 command => 'adduser buildd sbuild',
180 onlyif => "getent group sbuild > /dev/null && ! getent group sbuild | grep '\\<buildd\\>' > /dev/null"