aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands/deploy.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/deploy.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/deploy.rb')
-rw-r--r--lib/leap_cli/commands/deploy.rb21
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/leap_cli/commands/deploy.rb b/lib/leap_cli/commands/deploy.rb
index 9ec984c..c5efed5 100644
--- a/lib/leap_cli/commands/deploy.rb
+++ b/lib/leap_cli/commands/deploy.rb
@@ -6,12 +6,21 @@ module LeapCli
arg_name '<node filter>'
command :deploy do |c|
c.action do |global_options,options,args|
- nodes = manager.filter(args)
- say "Deploying to these nodes: #{nodes.keys.join(', ')}"
- if agree "Continue? "
- say "deploy not yet implemented"
- else
- say "OK. Bye."
+ nodes = manager.filter!(args)
+ if nodes.size > 1
+ say "Deploying to these nodes: #{nodes.keys.join(', ')}"
+ unless agree "Continue? "
+ quit! "OK. Bye."
+ end
+ end
+ leap_root = '/root/leap'
+ ssh_connect(nodes) do |ssh|
+ ssh.leap.mkdir_leap leap_root
+ ssh.leap.rsync_update do |server|
+ node = manager.node(server.host)
+ {:source => Path.named_path([:hiera, node.name]), :dest => "#{leap_root}/config/#{node.name}.yaml"}
+ end
+ ssh.apply_puppet
end
end
end