]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
factor out schroot
authorStephen Gran <steve@lobefin.net>
Sun, 3 Mar 2013 13:30:34 +0000 (13:30 +0000)
committerStephen Gran <steve@lobefin.net>
Sun, 3 Mar 2013 13:30:34 +0000 (13:30 +0000)
Signed-off-by: Stephen Gran <steve@lobefin.net>
modules/buildd/files/default-schroot [deleted file]
modules/buildd/manifests/init.pp
modules/buildd/templates/etc/schroot/mount-defaults.erb [deleted file]
modules/schroot/files/default-schroot [new file with mode: 0644]
modules/schroot/manifests/init.pp [new file with mode: 0644]
modules/schroot/templates/etc/schroot/mount-defaults.erb [new file with mode: 0644]

diff --git a/modules/buildd/files/default-schroot b/modules/buildd/files/default-schroot
deleted file mode 100644 (file)
index b4131da..0000000
+++ /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"
index 307419a7db402727353581b65412b2901375bfce..dcf6fe74fbaa72f3ae7d012f318861b2d071d0d1 100644 (file)
@@ -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 (file)
index 9dc2d51..0000000
+++ /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)
-#
-# <file system> <mount point>   <type>  <options>       <dump>  <pass>
-<% 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 (file)
index 0000000..b4131da
--- /dev/null
@@ -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 (file)
index 0000000..d31f232
--- /dev/null
@@ -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 (file)
index 0000000..9dc2d51
--- /dev/null
@@ -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)
+#
+# <file system> <mount point>   <type>  <options>       <dump>  <pass>
+<% 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 %>
+