blob: b1ab7fde49bcad43bcb4a26bb1004b5c58c2f509 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
Facter.add("strongswan_ips") do
setcode do
bin = ['/usr/sbin/ipsec', '/usr/sbin/strongswan'].find do |f|
File.exists?(f)
end
return unless bin
output = Facter::Util::Resolution.exec(
"#{bin} statusall | grep -E '^ [0-9a-f]' | sort | uniq")
output = output.to_s.split("\n").collect(&:strip)
output.join(',') unless output.empty?
end
end
|