From 79afefc5c8a80da51fd735edfcd780c8be5b8ffc Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 6 Feb 2014 23:37:05 -0800 Subject: added support for 'monitor' ssh keys. --- lib/leap_cli/config/macros.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/leap_cli/config/macros.rb') diff --git a/lib/leap_cli/config/macros.rb b/lib/leap_cli/config/macros.rb index 8cc72f4..aaed77a 100644 --- a/lib/leap_cli/config/macros.rb +++ b/lib/leap_cli/config/macros.rb @@ -315,11 +315,15 @@ module LeapCli; module Config ## # - # creates a hash from the ssh key info in users directory, for use in updating authorized_keys file + # Creates a hash from the ssh key info in users directory, for use in + # updating authorized_keys file. Additionally, the 'monitor' public key is + # included, which is used by the monitor nodes to run particular commands + # remotely. # def authorized_keys hash = {} - Dir.glob(Path.named_path([:user_ssh, '*'])).sort.each do |keyfile| + keys = Dir.glob(Path.named_path([:user_ssh, '*'])) + keys.sort.each do |keyfile| ssh_type, ssh_key = File.read(keyfile).strip.split(" ") name = File.basename(File.dirname(keyfile)) hash[name] = { @@ -327,6 +331,11 @@ module LeapCli; module Config "key" => ssh_key } end + ssh_type, ssh_key = File.read(Path.named_path(:monitor_pub_key)).strip.split(" ") + hash[Leap::Platform.monitor_username] = { + "type" => ssh_type, + "key" => ssh_key + } hash end -- cgit v1.2.3