rename dsa-puppet-stuff to puppet-crontab
[mirror/dsa-puppet.git] / modules / buildd / manifests / pybuildd.pp
1 # pybuildd configuration
2 class buildd::pybuildd {
3   package { 'buildd':
4     ensure => purged,
5   }
6
7   package { ['python3-retrying', 'python3-yaml']:
8     ensure => installed,
9   }
10   file { '/home/buildd/.profile':
11     content  => @(EOT),
12       export XDG_RUNTIME_DIR="/run/user/$(id -u)"
13       export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"
14       | EOT
15     group   => buildd,
16     owner   => buildd,
17   }
18   file { '/home/buildd/logs':
19     ensure  => directory,
20     mode    => '2750',
21     group   => buildd,
22     owner   => buildd,
23   }
24   dsa_systemd::linger { 'buildd': }
25   file { '/etc/systemd/journald.conf.d':
26     ensure  => directory,
27     mode    => '755',
28   }
29   file { '/etc/systemd/journald.conf.d/persistency.conf':
30     source => 'puppet:///modules/dsa_systemd/persistency.conf',
31   }
32
33   # Make sure that the build directory have the correct permissions.
34   # This should go away once pybuildd issue #3 is solved.
35   file { '/home/buildd/build':
36     ensure  => directory,
37     mode    => '2750',
38     group   => buildd,
39     owner   => buildd,
40   }
41   # work around https://salsa.debian.org/wb-team/pybuildd/issues/11
42   concat::fragment { 'puppet-crontab--pybuildd-expire-logs':
43     target => '/etc/cron.d/puppet-crontab',
44     content  => @(EOF)
45       @daily buildd [ -d ~buildd/logs ] && find ~buildd/logs -type f -mtime +90 -delete
46       | EOF
47   }
48 }