lib/stack.rb in stack-kicker-0.0.13 vs lib/stack.rb in stack-kicker-0.0.14
- old
+ new
@@ -480,14 +480,16 @@
Logger.debug { "config[:all_instances][= #{config[:all_instances]}" }
Logger.debug { "<<< Stack.categorise_instance_ips" }
end
def Stack.get_public_ip(config, hostname)
+ Logger.debug { "Stack.get_public_ip getting public IP for #{hostname}" }
# get a public address from the instance
# (could be either the dynamic or one of our floating IPs
config[:all_instances][hostname][:addresses].each do |address|
if address.label == 'public'
+ Logger.debug { "public IP for #{hostname} is #{address.address}" }
return address.address
end
end
end
@@ -821,14 +823,14 @@
post_install_script_abs = File.realpath(config[:stackhome] + '/' + role_details[:post_install_script])
post_install_cwd_abs = File.realpath(config[:stackhome] + '/' + role_details[:post_install_cwd])
# replace any tokens in the argument
public_ip = Stack.get_public_ip(config, hostname)
- role_details[:post_install_args].sub!(%q!%PUBLIC_IP%!, public_ip)
+ post_install_args = role_details[:post_install_args].sub(%q!%PUBLIC_IP%!, public_ip)
# we system this, so that the script can give live feed back
- Logger.info "Executing '#{post_install_script_abs} #{role_details[:post_install_args]}' in #{post_install_cwd_abs} as the post_install_script"
- system("cd #{post_install_cwd_abs} ; #{post_install_script_abs} #{role_details[:post_install_args]}")
+ Logger.info "Executing '#{post_install_script_abs} #{post_install_args]}' in #{post_install_cwd_abs} as the post_install_script"
+ system("cd #{post_install_cwd_abs} ; #{post_install_script_abs} #{post_install_args]}")
end
else
Logger.info "Skipped role #{role}"
end
end