summaryrefslogtreecommitdiffstats
path: root/genome-bootstrap/bin
diff options
context:
space:
mode:
Diffstat (limited to 'genome-bootstrap/bin')
-rw-r--r--genome-bootstrap/bin/genome-bootstrap30
1 files changed, 25 insertions, 5 deletions
diff --git a/genome-bootstrap/bin/genome-bootstrap b/genome-bootstrap/bin/genome-bootstrap
index 54e590f..6da5efc 100644
--- a/genome-bootstrap/bin/genome-bootstrap
+++ b/genome-bootstrap/bin/genome-bootstrap
@@ -25,15 +25,18 @@ Main {
say_red("\nYour genome repo server is the system that serves as the")
say_red("puppet master, git server, and cobbler server all in one.")
- @repo = ask("Enter your Genome repo machine name (leave off the '-repo'): ")
+ @repo = ask("Enter your Genome repo fully qualified domain name (fqdn): ")
say_red("\nYour cloud master is the server that determines where the")
say_red("machine you're trying to create will be provisioned. Typically")
say_red("cloud masters control several machines in a cloud. However,")
say_red("cloud masters can be configured to simply manage their own disk space.")
- @cloudmaster = ask("Enter your cloud master: ")
+ @cloudmaster = ask("Enter your cloud master fqdn: ")
@email = ask("Enter your email address for cloud notifications: ")
+ # 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")
@@ -53,8 +56,10 @@ Main {
menu.choices(*@genome_repo.machines.map{|m| m.name})
end
- # This might be useful is we stop using DDNS
+ # Nice to keep around with the machine's specification
@facts["genome_machine_type"] = @machine_type
+ @system_name = "#{@system_prefix}-#{@machine_type}"
+ @facts["genome_system_name"] = @system_name
say_red("\nYour cobbler profile determines the OS, the disk space, and")
say_red("the amount of memory that should be allocated to the system")
@@ -90,13 +95,28 @@ Main {
classes = @genome_repo.classes_for(@machine_type)
config = {"classes" => classes, "parameters" => @facts}
- @genome_repo.register_machine(@fqdn, config)
+ @genome_repo.register_machine(@system_name, config)
unless config_only
cloud_master = CloudController.new(@cloudmaster, @genome_repo)
- cloud_master.create_machine(@fqdn, @email)
+ host = cloud_master.create_machine(@system_name, @email)
if @genome_repo.cobbler_dns?
@genome_repo.register_dns_entry
end
+
+ installed_system = @genome_repo.get_installed_system(@system_name)
+ if not installed_system.empty?
+ if @genome_repo.cobbler_dns?
+ # register the new system with cobbler dns using the name,
+ # the installed_system's IP
+ end
+ fqdn = installed_system["hostname"]
+ say("Your new system is being provisioned on #{host}.")
+ say("The FQDN of new system is #{fqdn}.")
+ say("The IP address of the new system is #{installed_system["ip"]}.")
+ else
+ say("Your new system is being provisioned on #{host}.")
+ say("You can visit #{@cloudmaster.cloud} to see the status of the new system.")
+ end
end
end