X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fbuildd%2Fmanifests%2Finit.pp;h=e0a5ad838201be4f9fdd3f8ee2da546840183581;hb=d2eee596860e1342e23cb3f48a92f4e6af20a838;hp=3a9d5087aa50b6d306cc038340f6b9b7a1605789;hpb=6472d1591bd84323a79e43dff6bcf7e044f62bc8;p=mirror%2Fdsa-puppet.git diff --git a/modules/buildd/manifests/init.pp b/modules/buildd/manifests/init.pp index 3a9d5087a..e0a5ad838 100644 --- a/modules/buildd/manifests/init.pp +++ b/modules/buildd/manifests/init.pp @@ -1,9 +1,7 @@ -class buildd { +class buildd ($ensure=present) { + + include schroot - package { 'schroot': - ensure => installed, - tag => extra_repo, - } package { 'sbuild': ensure => installed, tag => extra_repo, @@ -17,16 +15,18 @@ class buildd { package { 'apt-transport-https': ensure => installed, } - package { [ - 'debootstrap', - 'dupload' - ]: - 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::linux_module { 'dm_snapshot': } - ferm::module { 'nf_conntrack_ftp': } - site::aptrepo { 'buildd': ensure => absent, } @@ -46,22 +46,26 @@ class buildd { require => Package['apt-transport-https'], } - if $::hostname in [alkman,porpora,zandonai] { - site::aptrepo { 'buildd.debian.org-proposed': - url => 'https://buildd.debian.org/apt/', - suite => "${suite}-proposed", - 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'], } - if $::hostname in [krenek] { - site::aptrepo { 'buildd.debian.org-experimental': - url => 'https://buildd.debian.org/apt/', - suite => "${suite}-experimental", - 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 @@ -72,21 +76,26 @@ class buildd { content => template('buildd/etc/apt/preferences.d/buildd'), before => Site::Aptrepo['buildd.debian.org'] } - file { '/etc/schroot/mount-defaults': - content => template('buildd/etc/schroot/mount-defaults.erb'), - require => Package['sbuild'], - } file { '/etc/cron.d/dsa-buildd': source => 'puppet:///modules/buildd/cron.d-dsa-buildd', require => Package['debian.org'] } - file { '/etc/dupload.conf': - source => 'puppet:///modules/buildd/dupload.conf', - require => Package['dupload'], + + 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/default/schroot': - source => 'puppet:///modules/buildd/default-schroot', - require => Package['schroot'] + file { '/etc/cron.d/puppet-buildd-aptitude': + content => "*/5 * * * * root /usr/local/sbin/buildd-schroot-aptitude-kill\n", } - }