aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands/compile.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2012-10-23 03:53:06 -0700
committerelijah <elijah@riseup.net>2012-10-23 03:53:06 -0700
commit628165fd0a4e03bb7bbef3a464447924195e10b8 (patch)
tree746280b6f4d6d488fcece4fff41b4addfb77d0c1 /lib/leap_cli/commands/compile.rb
parent4f38e99c629f60d9524d1cf23efa7ab927ac9cf4 (diff)
downloadleap_cli-628165fd0a4e03bb7bbef3a464447924195e10b8.tar.gz
leap_cli-628165fd0a4e03bb7bbef3a464447924195e10b8.tar.bz2
added a bunch of new commands, including init-node and deploy
Diffstat (limited to 'lib/leap_cli/commands/compile.rb')
-rw-r--r--lib/leap_cli/commands/compile.rb16
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/leap_cli/commands/compile.rb b/lib/leap_cli/commands/compile.rb
index 429d1c5..c5bb93e 100644
--- a/lib/leap_cli/commands/compile.rb
+++ b/lib/leap_cli/commands/compile.rb
@@ -5,20 +5,14 @@ module LeapCli
desc 'Compile json files to hiera configs'
command :compile do |c|
c.action do |global_options,options,args|
- manager.load(Path.provider)
- ensure_dir(Path.hiera)
- manager.export(Path.hiera)
- update_authorized_keys
- update_known_hosts
+ update_compiled_ssh_configs # this must come first, hiera configs import these files.
+ manager.export Path.named_path(:hiera_dir) # generate a hiera .yaml config for each node
end
end
- def update_authorized_keys
- buffer = StringIO.new
- Dir.glob(named_path(:user_ssh, '*')).each do |keyfile|
- buffer << File.read(keyfile)
- end
- write_file!(:authorized_keys, buffer.string)
+ def update_compiled_ssh_configs
+ update_authorized_keys
+ update_known_hosts
end
end