From 08db4adc0fcaab1be3eb4cdeb0d90efd458e35cf Mon Sep 17 00:00:00 2001 From: Greg Blomquist Date: Wed, 9 Jul 2008 17:30:13 -0400 Subject: Fixed a couple of bugs in genome-bootstrap: * replaced references to "fqdn" with "system-name" in the run method. - Instead of collecting the fqdn, or constructing based on Red Had-specific DNS information, we now only collect enough information for a cobbler system name. * eliminated ability to specify a genome repo by "leaving off the -repo" - Since we cannot assume that any repo (or any machine) will have a "usersys.redhat.com" suffix, the ability to specify a "partial" repo name has been removed. Users are now prompted for the fully qualified domain name of the repo. * selecting first element from installed_systems - With the introduction of "restr_get" that makes sure that all RESTR GET calls return an array (even of only one element), the "get_installed_systems" method needed to change to select the first (and only) element in the installed systems array. Otherwise, "cannot convert Integer to String". --- genome-bootstrap/bin/genome-bootstrap | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'genome-bootstrap/bin') 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 -- cgit