commit | e5fcb2d12209549e3077b4858120d9295a974152 | [log] [tgz] |
---|---|---|
author | codec <codec@fnord.cx> | Thu Jul 05 00:03:17 2012 +0200 |
committer | codec <codec@fnord.cx> | Thu Jul 05 00:03:31 2012 +0200 |
tree | 6f05a8148de2b388ef0b8c64bfa9e4eccf7afbd8 | |
parent | 590a0031f2181bd70b759393c06962e4fce4412c [diff] |
add fact backuppc_hosts which lists configured hosts
diff --git a/lib/facter/backuppc_hosts.rb b/lib/facter/backuppc_hosts.rb new file mode 100644 index 0000000..44db8ac --- /dev/null +++ b/lib/facter/backuppc_hosts.rb
@@ -0,0 +1,10 @@ +Facter.add('backuppc_hosts') do + setcode do + if File.exists?('/etc/backuppc/hosts') + data = File.open('/etc/backuppc/hosts').read.split(/\n/) + data.shift + + data.map {|it| it.split(' ')[0] } + end + end +end \ No newline at end of file