From 3424eb58d3f2fd92979867dd3ee4afb6382d9fe5 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 21 Feb 2010 13:52:00 +0100 Subject: [PATCH] Add a facter that collects ssh keys of the portforwarder user --- facts/portforwarder.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 facts/portforwarder.rb diff --git a/facts/portforwarder.rb b/facts/portforwarder.rb new file mode 100644 index 000000000..f7eeb91d4 --- /dev/null +++ b/facts/portforwarder.rb @@ -0,0 +1,14 @@ +Facter.add("portforwarder") do + setcode do + key = nil + keyfile = '/home/portforwarder/.ssh/id_rsa.pub' + if FileTest.exist?(keyfile) + key = File.open(keyfile).read.chomp + end + key + end +end + +# vim:set et: +# vim:set ts=4: +# vim:set shiftwidth=4: -- 2.20.1