/usr/share/puppet/modules.available/nanliu-staging/lib/facter/staging_http_get.rb is in puppet-module-nanliu-staging 1.0.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | Facter.add("staging_http_get") do
setcode do
fact = nil
which = lambda do |cmd|
result = nil
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
exts.each do |ext|
exe = File.join(path, "#{cmd}#{ext}")
result = exe if File.executable? exe
break if result
end
break if result
end
result
end
['powershell', 'curl', 'wget'].each do |cmd|
available = which.call(cmd)
fact = available ? cmd : nil
break if fact
end
fact
end
end
|