X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fbuildd%2Fmanifests%2Finit.pp;h=e0a5ad838201be4f9fdd3f8ee2da546840183581;hb=d2eee596860e1342e23cb3f48a92f4e6af20a838;hp=8f68e6905f2469c46074cd49e9a011a58b8965c5;hpb=c4718c4edcce0add4fea04db5eb2fc4bf808c8cf;p=mirror%2Fdsa-puppet.git diff --git a/modules/buildd/manifests/init.pp b/modules/buildd/manifests/init.pp index 8f68e6905..e0a5ad838 100644 --- a/modules/buildd/manifests/init.pp +++ b/modules/buildd/manifests/init.pp @@ -1,22 +1,101 @@ -class buildd { - package { - "sbuild": ensure => installed; - "buildd": ensure => installed; - "buildd-builder-meta": ensure => installed; - "apt-transport-https": ensure => installed; - "debootstrap": ensure => installed; - } - - file { - "/etc/apt/sources.list.d/buildd.list": - source => "puppet:///files/etc/apt/sources.list.d/buildd.list", - require => Package["apt-transport-https"] - ; - - "/etc/apt/trusted-keys.d/buildd.debian.org.asc": - source => "puppet:///buildd/buildd.debian.org.asc", - mode => 664, - notify => Exec["apt-keys-update"], - ; - } +class buildd ($ensure=present) { + + include schroot + + package { 'sbuild': + ensure => installed, + tag => extra_repo, + } + package { 'libsbuild-perl': + ensure => installed, + tag => extra_repo, + before => Package['sbuild'] + } + + package { 'apt-transport-https': + ensure => installed, + } + if $ensure == present { + package { 'dupload': + ensure => installed, + } + file { '/etc/dupload.conf': + source => 'puppet:///modules/buildd/dupload.conf', + require => Package['dupload'], + } + site::linux_module { 'dm_snapshot': } + ferm::module { 'nf_conntrack_ftp': } + } + + site::aptrepo { 'buildd': + ensure => absent, + } + + $suite = $::lsbdistcodename ? { + squeeze => $::lsbdistcodename, + wheezy => $::lsbdistcodename, + undef => 'squeeze', + default => 'wheezy' + } + + site::aptrepo { 'buildd.debian.org': + key => 'puppet:///modules/buildd/buildd.debian.org.asc', + url => 'https://buildd.debian.org/apt/', + suite => $suite, + components => 'main', + require => Package['apt-transport-https'], + } + + site::aptrepo { 'buildd.debian.org-proposed': + ensure => $::hostname ? { + /^(alkman|barber|brahms|porpora|zandonai)$/ => 'present', + default => 'absent', + }, + url => 'https://buildd.debian.org/apt/', + suite => "${suite}-proposed", + components => 'main', + require => Package['apt-transport-https'], + } + + site::aptrepo { 'buildd.debian.org-experimental': + ensure => $::hostname ? { + /^(krenek)$/ => 'present', + default => 'absent', + }, + url => 'https://buildd.debian.org/apt/', + suite => "${suite}-experimental", + components => 'main', + require => Package['apt-transport-https'], + } + + # 'bad' extension + file { '/etc/apt/preferences.d/buildd.debian.org': + ensure => absent, + } + file { '/etc/apt/preferences.d/buildd': + content => template('buildd/etc/apt/preferences.d/buildd'), + before => Site::Aptrepo['buildd.debian.org'] + } + file { '/etc/cron.d/dsa-buildd': + source => 'puppet:///modules/buildd/cron.d-dsa-buildd', + require => Package['debian.org'] + } + + if ($::lsbmajdistrelease >= 7 and $::kernel == 'Linux') { + package { 'python-psutil': + ensure => installed, + } + file { '/usr/local/sbin/buildd-schroot-aptitude-kill': + source => 'puppet:///modules/buildd/buildd-schroot-aptitude-kill', + mode => '0555', + } + } else { + file { '/usr/local/sbin/buildd-schroot-aptitude-kill': + source => 'puppet:///modules/buildd/buildd-schroot-aptitude-kill.squeeze', + mode => '0555', + } + } + file { '/etc/cron.d/puppet-buildd-aptitude': + content => "*/5 * * * * root /usr/local/sbin/buildd-schroot-aptitude-kill\n", + } }