From 6c0e7ac12bb7780ec5705e9d905938e532c84308 Mon Sep 17 00:00:00 2001 From: Samuel Beaulieu Date: Thu, 28 Jul 2022 13:04:24 -0500 Subject: [PATCH] add a condition for the aws node setup (ssh) if a domain is set then we use the 'spicy-proton' hostname otherwise it uses the private dns name --- lib/vmpooler/providers/ec2.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/vmpooler/providers/ec2.rb b/lib/vmpooler/providers/ec2.rb index 541eade..aa0a91f 100644 --- a/lib/vmpooler/providers/ec2.rb +++ b/lib/vmpooler/providers/ec2.rb @@ -276,10 +276,14 @@ module Vmpooler @redis.with_metrics do |redis| redis.hset("vmpooler__vm__#{new_vmname}", 'host', created_instance['private_dns_name']) end - # extra setup steps - provision_node_aws(created_instance['private_dns_name'], pool_name, new_vmname) if to_provision(pool_name) == 'true' || to_provision(pool_name) == true - dns_setup(created_instance) if domain + if domain + dns_setup(created_instance) + provision_node_aws(created_instance['name'], pool_name, new_vmname) if to_provision(pool_name) == 'true' || to_provision(pool_name) == true + elsif to_provision(pool_name) == 'true' || to_provision(pool_name) == true + provision_node_aws(created_instance['private_dns_name'], pool_name, new_vmname) + end + created_instance end