]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
set hostname on `leap node init`
authorelijah <elijah@riseup.net>
Thu, 14 Mar 2013 07:20:41 +0000 (00:20 -0700)
committerelijah <elijah@riseup.net>
Thu, 14 Mar 2013 07:20:41 +0000 (00:20 -0700)
lib/leap_cli/commands/node.rb
lib/leap_cli/remote/tasks.rb

index 7b929e08f4363fc6141d17083c47ae3a802747b1..8ebb5e850d3b4111d6c2c572e48f9ba067903b06 100644 (file)
@@ -52,13 +52,14 @@ module LeapCli; module Commands
     node.command :init do |init|
       init.switch 'echo', :desc => 'If set, passwords are visible as you type them (default is hidden)', :negatable => false
       init.action do |global,options,args|
-        assert! args.any?, 'You must specify a node-filter'
+        assert! args.any?, 'You must specify a FILTER'
         finished = []
         manager.filter!(args).each_node do |node|
           ping_node(node)
           save_public_host_key(node, global)
           update_compiled_ssh_configs
           ssh_connect(node, :bootstrap => true, :echo => options[:echo]) do |ssh|
+            ssh.set_hostname
             ssh.install_authorized_keys
             ssh.install_prerequisites
           end
index 4df2cee24c5409c40a6c600d42d870a593aa9327..35349add73ed4c0c6a1f4e22aac5bf28e588a94a 100644 (file)
@@ -14,6 +14,12 @@ task :install_authorized_keys, :max_hosts => MAX_HOSTS do
   end
 end
 
+task :set_hostname, :max_hosts => MAX_HOSTS do
+  leap.log :setting, "hostname" do
+    run "hostname $CAPISTRANO:HOST$"
+  end
+end
+
 task :install_prerequisites, :max_hosts => MAX_HOSTS do
   leap.mkdirs puppet_destination
   run "locale-gen"