From: Stephen Gran Date: Sun, 3 Mar 2013 13:30:34 +0000 (+0000) Subject: factor out schroot X-Git-Url: https://git.donarmstrong.com/?p=dsa-puppet.git;a=commitdiff_plain;h=16e295d6dcd715d959e2fad2cf0e25ba2938058e factor out schroot Signed-off-by: Stephen Gran --- diff --git a/modules/buildd/files/default-schroot b/modules/buildd/files/default-schroot deleted file mode 100644 index b4131da5..00000000 --- a/modules/buildd/files/default-schroot +++ /dev/null @@ -1,16 +0,0 @@ -## -## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE. -## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git -## -# This is a configuration file for /etc/init.d/schroot; it allows you -# to perform common modifications to the behavior of schroot -# initialization without editing the init script (and thus getting -# prompted by dpkg on upgrades). Note that the defaults defined here -# are not used when invoking the schroot command; to configure schroot -# behaviour have a look at /etc/schroot/* and the schroot manual page -# ("man schroot"). - -# What do we want to do with "orphan" sessions when starting or -# restarting? Recover them (leave empty or set to "recover") or just -# end them (set to "end")? -SESSIONS_RECOVER="end" diff --git a/modules/buildd/manifests/init.pp b/modules/buildd/manifests/init.pp index 307419a7..dcf6fe74 100644 --- a/modules/buildd/manifests/init.pp +++ b/modules/buildd/manifests/init.pp @@ -1,45 +1,30 @@ class buildd ($ensure=present) { - $package_ensure = $ensure ? { - present => installed, - absent => $ensure - } + include schroot - package { 'schroot': - ensure => $package_ensure, - tag => extra_repo, - } package { 'sbuild': - ensure => $package_ensure, + ensure => installed, tag => extra_repo, } package { 'libsbuild-perl': - ensure => $package_ensure, + ensure => installed, tag => extra_repo, before => Package['sbuild'] } package { 'apt-transport-https': - ensure => $package_ensure, + ensure => installed, } if $ensure == present { - package { [ - 'debootstrap', - 'dupload' - ]: + package { 'dupload': ensure => installed, } file { '/etc/dupload.conf': - ensure => $ensure, source => 'puppet:///modules/buildd/dupload.conf', require => Package['dupload'], } - site::linux_module { 'dm_snapshot': - ensure => $ensure - } - ferm::module { 'nf_conntrack_ftp': - ensure => $ensure - } + site::linux_module { 'dm_snapshot': } + ferm::module { 'nf_conntrack_ftp': } } site::aptrepo { 'buildd': @@ -54,7 +39,6 @@ class buildd ($ensure=present) { } site::aptrepo { 'buildd.debian.org': - ensure => $ensure, key => 'puppet:///modules/buildd/buildd.debian.org.asc', url => 'https://buildd.debian.org/apt/', suite => $suite, @@ -85,23 +69,11 @@ class buildd ($ensure=present) { ensure => absent, } file { '/etc/apt/preferences.d/buildd': - ensure => $ensure, content => template('buildd/etc/apt/preferences.d/buildd'), before => Site::Aptrepo['buildd.debian.org'] } - file { '/etc/schroot/mount-defaults': - ensure => $ensure, - content => template('buildd/etc/schroot/mount-defaults.erb'), - require => Package['sbuild'], - } file { '/etc/cron.d/dsa-buildd': - ensure => $ensure, source => 'puppet:///modules/buildd/cron.d-dsa-buildd', require => Package['debian.org'] } - file { '/etc/default/schroot': - ensure => $ensure, - source => 'puppet:///modules/buildd/default-schroot', - require => Package['schroot'] - } } diff --git a/modules/buildd/templates/etc/schroot/mount-defaults.erb b/modules/buildd/templates/etc/schroot/mount-defaults.erb deleted file mode 100644 index 9dc2d518..00000000 --- a/modules/buildd/templates/etc/schroot/mount-defaults.erb +++ /dev/null @@ -1,22 +0,0 @@ -## -## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE. -## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git -## -# mount.defaults: static file system information for chroots. -# Note that the mount point will be prefixed by the chroot path -# (CHROOT_PATH) -# -# -<% if scope.lookupvar('site::nodeinfo')['ldap'].has_key?('architecture') and scope.lookupvar('site::nodeinfo')['ldap']['architecture'][0].start_with?('kfreebsd') -%> -# kFreeBSD version -proc /proc linprocfs defaults 0 0 -dev /dev devfs rw,bind 0 0 -dev /dev/fd fdescfs rw,bind 0 0 -sys /sys linsysfs defaults 0 0 -<% else -%> -# Linux version -proc /proc proc defaults 0 0 -/dev/pts /dev/pts none rw,bind 0 0 -tmpfs /dev/shm tmpfs defaults 0 0 -<% end %> - diff --git a/modules/schroot/files/default-schroot b/modules/schroot/files/default-schroot new file mode 100644 index 00000000..b4131da5 --- /dev/null +++ b/modules/schroot/files/default-schroot @@ -0,0 +1,16 @@ +## +## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE. +## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git +## +# This is a configuration file for /etc/init.d/schroot; it allows you +# to perform common modifications to the behavior of schroot +# initialization without editing the init script (and thus getting +# prompted by dpkg on upgrades). Note that the defaults defined here +# are not used when invoking the schroot command; to configure schroot +# behaviour have a look at /etc/schroot/* and the schroot manual page +# ("man schroot"). + +# What do we want to do with "orphan" sessions when starting or +# restarting? Recover them (leave empty or set to "recover") or just +# end them (set to "end")? +SESSIONS_RECOVER="end" diff --git a/modules/schroot/manifests/init.pp b/modules/schroot/manifests/init.pp new file mode 100644 index 00000000..d31f2329 --- /dev/null +++ b/modules/schroot/manifests/init.pp @@ -0,0 +1,18 @@ +class schroot { + package { 'schroot': + ensure => installed, + tag => extra_repo, + } + package { 'debootstrap': + ensure => installed, + } + + file { '/etc/schroot/mount-defaults': + content => template('schroot/etc/schroot/mount-defaults.erb'), + require => Package['sbuild'], + } + file { '/etc/default/schroot': + source => 'puppet:///modules/schroot/default-schroot', + require => Package['schroot'] + } +} diff --git a/modules/schroot/templates/etc/schroot/mount-defaults.erb b/modules/schroot/templates/etc/schroot/mount-defaults.erb new file mode 100644 index 00000000..9dc2d518 --- /dev/null +++ b/modules/schroot/templates/etc/schroot/mount-defaults.erb @@ -0,0 +1,22 @@ +## +## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE. +## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git +## +# mount.defaults: static file system information for chroots. +# Note that the mount point will be prefixed by the chroot path +# (CHROOT_PATH) +# +# +<% if scope.lookupvar('site::nodeinfo')['ldap'].has_key?('architecture') and scope.lookupvar('site::nodeinfo')['ldap']['architecture'][0].start_with?('kfreebsd') -%> +# kFreeBSD version +proc /proc linprocfs defaults 0 0 +dev /dev devfs rw,bind 0 0 +dev /dev/fd fdescfs rw,bind 0 0 +sys /sys linsysfs defaults 0 0 +<% else -%> +# Linux version +proc /proc proc defaults 0 0 +/dev/pts /dev/pts none rw,bind 0 0 +tmpfs /dev/shm tmpfs defaults 0 0 +<% end %> +