Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support for using dynamically set password in templates and increase

Wait times.
  • Loading branch information...
commit 553990316760351ced2e658a02e0e4936161e7e6 1 parent 0c56d27
Chirag Jog authored
Showing with 8 additions and 6 deletions.
  1. +8 −6 lib/chef/knife/cs_server_create.rb
View
14 lib/chef/knife/cs_server_create.rb
@@ -23,10 +23,10 @@ module KnifeCloudstack
class CsServerCreate < Chef::Knife
# Seconds to delay between detecting ssh and initiating the bootstrap
- BOOTSTRAP_DELAY = 3
+ BOOTSTRAP_DELAY = 20
# Seconds to wait between ssh pings
- SSH_POLL_INTERVAL = 2
+ SSH_POLL_INTERVAL = 10
deps do
require 'chef/knife/bootstrap'
@@ -200,7 +200,9 @@ def run
puts "\n"
}
- bootstrap_for_node(public_ip).run
+ username = locate_config_value(:ssh_user) || "root"
+ password = locate_config_value(:ssh_password) || server.password
+ bootstrap_for_node(public_ip, username, password).run
puts "\n"
puts "#{ui.color("Name", :cyan)}: #{server['name']}"
@@ -290,12 +292,12 @@ def is_ssh_open?(ip)
end
- def bootstrap_for_node(host)
+ def bootstrap_for_node(host, username, password)
bootstrap = Chef::Knife::Bootstrap.new
bootstrap.name_args = [host]
bootstrap.config[:run_list] = config[:run_list]
- bootstrap.config[:ssh_user] = config[:ssh_user]
- bootstrap.config[:ssh_password] = config[:ssh_password]
+ bootstrap.config[:ssh_user] = username
+ bootstrap.config[:ssh_password] = password
bootstrap.config[:identity_file] = config[:identity_file]
bootstrap.config[:chef_node_name] = config[:chef_node_name] if config[:chef_node_name]
bootstrap.config[:prerelease] = config[:prerelease]
Please sign in to comment.
Something went wrong with that request. Please try again.