Add /etc/schroot/buildd/config with CHROOT_FILE_UNPACK_DIR=/srv/buildd/unpack if...
authorPeter Palfrader <peter@palfrader.org>
Wed, 10 Dec 2014 19:52:53 +0000 (20:52 +0100)
committerPeter Palfrader <peter@palfrader.org>
Wed, 10 Dec 2014 19:52:53 +0000 (20:52 +0100)
modules/debian-org/lib/facter/paths.rb
modules/schroot/manifests/init.pp

index e48fb60..b8b7b06 100644 (file)
@@ -16,6 +16,15 @@ Facter.add("has_srv_buildd") do
                end
        end
 end
+Facter.add("has_srv_buildd") do
+       setcode do
+               if FileTest.exist?("/srv/buildd")
+                       true
+               else
+                       ''
+               end
+       end
+end
 Facter.add("has_etc_ssh_ssh_host_ed25519_key") do
        setcode do
                if FileTest.exist?("/etc/ssh/ssh_host_ed25519_key")
index d9ca261..1716fbb 100644 (file)
@@ -62,4 +62,11 @@ class schroot {
                content => template('schroot/schroot-buildd/fstab.erb'),
                require => Package['schroot'],
        }
+
+       if $has_srv_buildd {
+               file { '/etc/schroot/buildd/config':
+                       content => "CHROOT_FILE_UNPACK_DIR=/srv/buildd/unpack",
+                       require => Package['schroot'],
+               }
+       }
 }