X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fbuildd%2Fmanifests%2Finit.pp;h=2ddf0663e779d29035051dacc8f3040bd7bd0185;hb=99ea046a8d65d34eff7373ca245f7133a02af9f4;hp=8f68e6905f2469c46074cd49e9a011a58b8965c5;hpb=4f00ce2e4a587c1165f049ebb3cf5f03104783fd;p=mirror%2Fdsa-puppet.git diff --git a/modules/buildd/manifests/init.pp b/modules/buildd/manifests/init.pp index 8f68e6905..2ddf0663e 100644 --- a/modules/buildd/manifests/init.pp +++ b/modules/buildd/manifests/init.pp @@ -1,22 +1,100 @@ -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 ? { + # /^(xxxx)$/ => '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': + ensure => absent, + } + 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", + } }