From 2ab3fafdddbc54a0568679956460fcd7001fa85e Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 7 Sep 2019 16:19:33 +0200 Subject: [PATCH] facter for git key --- modules/debian_org/lib/facter/roleaccounts.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/debian_org/lib/facter/roleaccounts.rb b/modules/debian_org/lib/facter/roleaccounts.rb index d95dc0419..b3a1a803c 100644 --- a/modules/debian_org/lib/facter/roleaccounts.rb +++ b/modules/debian_org/lib/facter/roleaccounts.rb @@ -1,6 +1,17 @@ begin require 'etc' + Facter.add("git_key") do + setcode do + key = nil + keyfile = '/home/git/.ssh/id_rsa.pub' + if FileTest.exist?(keyfile) + key = File.open(keyfile).read.chomp + end + key + end + end + Facter.add("postgresql_key") do setcode do key = nil -- 2.20.1