X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=modules%2Fbuildd%2Fmanifests%2Finit.pp;h=ee60baa7fb7cfc2531b062fc8161565d535db5fa;hb=5715c43a537e3db4c51ee698056b70435b3127a8;hp=05e0282244a89a12e894349645b08d6e8f62a8c5;hpb=dd481ef19e3bfe5438e38d74f77d07ebc3ecdd89;p=dsa-puppet.git diff --git a/modules/buildd/manifests/init.pp b/modules/buildd/manifests/init.pp index 05e02822..ee60baa7 100644 --- a/modules/buildd/manifests/init.pp +++ b/modules/buildd/manifests/init.pp @@ -23,6 +23,13 @@ class buildd ($ensure=present) { source => 'puppet:///modules/buildd/dupload.conf', require => Package['dupload'], } + package { 'buildd': + ensure => installed, + } + file { '/etc/buildd/buildd.conf': + source => 'puppet:///modules/buildd/buildd.conf', + require => Package['buildd'], + } site::linux_module { 'dm_snapshot': } include ferm::ftp_conntrack } @@ -32,28 +39,35 @@ class buildd ($ensure=present) { } $suite = $::lsbdistcodename ? { - squeeze => $::lsbdistcodename, - wheezy => $::lsbdistcodename, + squeeze => $::lsbdistcodename, + wheezy => $::lsbdistcodename, + jessie => $::lsbdistcodename, + stretch => $::lsbdistcodename, undef => 'squeeze', default => 'wheezy' } + $buildd_apt_url = $::debarchitecture ? { + /^sparc$/ => 'http://buildd.debian.org/apt/', + default => 'https://buildd.debian.org/apt/', + } + site::aptrepo { 'buildd.debian.org': key => 'puppet:///modules/buildd/buildd.debian.org.gpg', - url => 'https://buildd.debian.org/apt/', + url => $buildd_apt_url, suite => $suite, components => 'main', require => Package['apt-transport-https'], } $buildd_prop_ensure = $::hostname ? { - /^(alkman|brahms|porpora|zandonai)$/ => 'present', + /^(alkman|zandonai)$/ => 'present', default => 'absent', } if ($::lsbmajdistrelease >= 8) { file { '/etc/apt/apt.conf.d/puppet-https-buildd': - content => "Acquire::https::buildd.debian.org::CaInfo \"/usr/share/ca-certificates/mozilla/UTN_USERFirst_Hardware_Root_CA.crt\";\n", + content => "Acquire::https::buildd.debian.org::CaInfo \"/etc/ssl/ca-debian/ca-certificates.crt\";\n", } } else { file { '/etc/apt/apt.conf.d/puppet-https-buildd': @@ -85,9 +99,16 @@ class buildd ($ensure=present) { package { 'python-psutil': ensure => installed, } - file { '/usr/local/sbin/buildd-schroot-aptitude-kill': - source => 'puppet:///modules/buildd/buildd-schroot-aptitude-kill', - mode => '0555', + if ($::lsbmajdistrelease >= 8) { + 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.wheezy', + mode => '0555', + } } } else { file { '/usr/local/sbin/buildd-schroot-aptitude-kill': @@ -99,10 +120,78 @@ class buildd ($ensure=present) { content => "*/5 * * * * root /usr/local/sbin/buildd-schroot-aptitude-kill\n", } - if $has_srv_buildd { file { '/etc/cron.d/puppet-update-buildd-schroots': content => "13 21 * * 0 root PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin setup-all-dchroots buildd\n", } } + + file { '/home/buildd': + ensure => directory, + mode => '2755', + group => buildd, + owner => buildd, + } + file { '/home/buildd/build': + ensure => directory, + mode => '2750', + group => buildd, + owner => buildd, + } + file { '/home/buildd/logs': + ensure => directory, + mode => '2750', + group => buildd, + owner => buildd, + } + file { '/home/buildd/old-logs': + ensure => directory, + mode => '2750', + group => buildd, + owner => buildd, + } + file { '/home/buildd/upload-security': + ensure => directory, + mode => '2750', + group => buildd, + owner => buildd, + } + file { '/home/buildd/stats': + ensure => directory, + mode => '2755', + group => buildd, + owner => buildd, + } + file { '/home/buildd/stats/graphs': + ensure => directory, + mode => '2755', + group => buildd, + owner => buildd, + } + file { '/home/buildd/upload': + ensure => directory, + mode => '2755', + group => buildd, + owner => buildd, + } + file { '/home/buildd/.forward': + content => "|/usr/bin/buildd-mail\n", + group => buildd, + owner => buildd, + } + + if ! $::buildd_key { + exec { 'create-buildd-key': + 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\'', + onlyif => '/usr/bin/getent passwd buildd > /dev/null && ! [ -e /home/buildd/.ssh/id_rsa ]' + } + } + + + if $::buildd_user_exists { + exec { 'add-buildd-user-to-sbuild': + command => 'adduser buildd sbuild', + onlyif => "getent group sbuild > /dev/null && ! getent group sbuild | grep '\\' > /dev/null" + } + } }