X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fdebian-org%2Flib%2Ffacter%2Fpaths.rb;h=47a010ce825698b7d702078c78ecba607e46eb63;hb=4326b0a78553bfe9696c10f1a69e1316acd23802;hp=e48fb600fa58dace3601cade368b7a4d5bcd08c4;hpb=2962d317313499eb88e8496fa672bf217f1bca2f;p=mirror%2Fdsa-puppet.git diff --git a/modules/debian-org/lib/facter/paths.rb b/modules/debian-org/lib/facter/paths.rb index e48fb600f..47a010ce8 100644 --- a/modules/debian-org/lib/facter/paths.rb +++ b/modules/debian-org/lib/facter/paths.rb @@ -1,27 +1,20 @@ -Facter.add("has_srv_build_trees") do - setcode do - if FileTest.exist?("/srv/build-trees") - true - else - '' - 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") - true - else - '' + +%w{/srv/build-trees + /srv/buildd + /etc/ssh/ssh_host_ed25519_key + /srv/mirrors/debian + /srv/mirrors/debian-debug + /srv/mirrors/debian-ports + /srv/mirrors/debian-security + /dev/hwrng +}.each do |path| + Facter.add("has" + path.gsub(/[\/-]/,'_')) do + setcode do + if FileTest.exist?(path) + true + else + '' + end end end end