From: Peter Palfrader Date: Sat, 7 Sep 2019 14:19:33 +0000 (+0200) Subject: facter for git key X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=2ab3fafdddbc54a0568679956460fcd7001fa85e;p=mirror%2Fdsa-puppet.git facter for git key --- 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