summaryrefslogtreecommitdiffstats
path: root/genome-bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'genome-bootstrap')
-rw-r--r--genome-bootstrap/bin/genome-bootstrap11
-rw-r--r--genome-bootstrap/lib/genome-bootstrap/core.rb6
2 files changed, 9 insertions, 8 deletions
diff --git a/genome-bootstrap/bin/genome-bootstrap b/genome-bootstrap/bin/genome-bootstrap
index 9deab7e..05ae6cc 100644
--- a/genome-bootstrap/bin/genome-bootstrap
+++ b/genome-bootstrap/bin/genome-bootstrap
@@ -56,12 +56,8 @@ Main {
# Allows genomed to know which cloudmaster is controlling this new machine
@facts["cloudmaster"] = @cloudmaster
- say_red("\nYour cobbler system name consists of two parts")
- say_red("\t* a system prefix")
- say_red("\t* a machine type")
- say_red("The system prefix can be used to help group common systems")
- say_red("together using some canonical name. For instance, this can be")
- say_red("helpful when configuring clustered JBoss servers")
+ say_red("\nYour system prefix is added to your machine name to help identify")
+ say_red("it as your own. It must be a single word and should be short (e.g. username).")
@system_prefix = ask("Enter your system prefix: ")
# Once we know the repo we can fetch the supported machines
@@ -114,9 +110,10 @@ Main {
@genome_repo.register_machine(@system_name, config)
unless config_only
cloud_master = CloudController.new(@cloudmaster, @genome_repo)
- host = cloud_master.create_machine(@system_name, @email)
+ id, host = cloud_master.create_machine(@system_name, @email)
if ip = get_system_ip(@genome_repo, @system_name)
+ cloud_master.update_hostname(id, ip)
say("Your new system is being provisioned on #{host}.")
say("The IP address of the new system is #{ip}.")
else
diff --git a/genome-bootstrap/lib/genome-bootstrap/core.rb b/genome-bootstrap/lib/genome-bootstrap/core.rb
index 8991753..5c1121c 100644
--- a/genome-bootstrap/lib/genome-bootstrap/core.rb
+++ b/genome-bootstrap/lib/genome-bootstrap/core.rb
@@ -170,7 +170,11 @@ module GenomeBootstrap
end
def create_machine(system_name, email)
- return Restr.post("#{@cloud}/koan", :system_name => system_name, :repo => @repo.fqdn, :email => email)
+ return Restr.post("#{@cloud}/koan", :system_name => system_name, :repo => @repo.fqdn, :email => email).split(":")
+ end
+
+ def update_hostname(id, hostname)
+ Restr.put("#{@cloud}/koan", :id => id, :hostname => hostname)
end
end
end