* Finished the sanity checks and user confirmation table when preparing to configure the network on a node or dr host.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 5 years ago
parent 6d81e03fb2
commit b97f15b25e
  1. 348
      cgi-bin/striker
  2. 117
      html/skins/alteeve/anvil.html
  3. 25
      html/skins/alteeve/main.css
  4. 8
      notes
  5. 12
      share/words.xml

@ -759,24 +759,74 @@ sub process_prep_network
return(0); return(0);
} }
# Is the user going back to the form?
if (($anvil->data->{cgi}{save}{value} eq "true") && ($anvil->data->{cgi}{back}{value}))
{
# User is going back.
$anvil->data->{cgi}{save}{value} = "";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "cgi::save::value" => $anvil->data->{cgi}{save}{value} }});
}
### NOTE: The weird 'form::config_step2::<x>::value is from reusing the logic used back when
### Striker's config was made. It's not the best, but it does the job. Would be nice to redo
### the logic later.
# Are we saving? # Are we saving?
if ($anvil->data->{cgi}{save}{value} eq "true") if ($anvil->data->{cgi}{save}{value} eq "true")
{ {
# Is the form sane? # Is the form sane?
my $sane = 1; my $sane = 1;
# Not yet, ask the user to confirm.
my $interfaces = ""; my $interfaces = "";
my $error = 0; my $error = 0;
my $gateway_interface = ""; my $gateway_interface = "";
if ($anvil->data->{cgi}{host_name}{value})
{
# Is the host name sane?
if (not $anvil->Validate->is_domain_name({name => $anvil->data->{cgi}{host_name}{value}}))
{
# Nope
my $error_message = $anvil->Words->string({key => "error_0012", variables => { host_name => $anvil->data->{cgi}{host_name}{value} }});
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $error_message }});
$anvil->data->{cgi}{host_name}{alert} = 1;
}
else
{
$anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step2::host_name::value",
variable_value => $anvil->data->{cgi}{host_name}{value},
variable_default => "",
variable_description => "striker_0159",
variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts",
update_value_only => 1,
});
}
}
if ($anvil->data->{cgi}{gateway}{value}) if ($anvil->data->{cgi}{gateway}{value})
{ {
# Is if valid? # Is if valid?
if (not $anvil->Validate->is_ipv4({ip => $anvil->data->{cgi}{gateway}{value}})) if (not $anvil->Validate->is_ipv4({ip => $anvil->data->{cgi}{gateway}{value}}))
{ {
# Bad IP # Bad IP
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "warning_0010", variables => { ip_address => $anvil->data->{cgi}{gateway}{value} }}) }}); my $error_message = $anvil->Words->string({key => "warning_0010", variables => { ip_address => $anvil->data->{cgi}{gateway}{value} }});
$anvil->data->{cgi}{gateway}{alert} = 1; $anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $error_message }});
$anvil->data->{cgi}{gateway}{alert} = 1;
}
else
{
# It's sane, record it.
$anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step2::gateway::value",
variable_value => $anvil->data->{cgi}{gateway}{value},
variable_default => "",
variable_description => "striker_0036",
variable_section => "config_step2",
variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts",
update_value_only => 1,
});
} }
} }
if ($anvil->data->{cgi}{dns}{value}) if ($anvil->data->{cgi}{dns}{value})
@ -793,6 +843,21 @@ sub process_prep_network
} }
last if $anvil->data->{cgi}{dns}{alert}; last if $anvil->data->{cgi}{dns}{alert};
} }
if (not $anvil->data->{cgi}{dns}{alert})
{
# It's sane, record it.
$anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step2::dns::value",
variable_value => $anvil->data->{cgi}{dns}{value},
variable_default => "",
variable_description => "striker_0038",
variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts",
update_value_only => 1,
});
}
} }
foreach my $network ("bcn", "sn", "ifn") foreach my $network ("bcn", "sn", "ifn")
{ {
@ -800,12 +865,13 @@ sub process_prep_network
my $loops = $anvil->data->{cgi}{$count_key}{value}; my $loops = $anvil->data->{cgi}{$count_key}{value};
foreach my $i (1..$loops) foreach my $i (1..$loops)
{ {
my $bridge_key = $network.$i."_create_bridge"; my $this_network = $network.$i;
my $ip_key = $network.$i."_ip"; my $bridge_key = $this_network."_create_bridge";
my $subnet_key = $network.$i."_subnet_mask"; my $ip_key = $this_network."_ip";
my $link1_key = $network.$i."_link1_mac_to_set"; my $subnet_key = $this_network."_subnet_mask";
my $link2_key = $network.$i."_link2_mac_to_set"; my $link1_key = $this_network."_link1_mac_to_set";
my $say_network = $anvil->Words->string({key => "striker_0018", variables => { number => $i }}); my $link2_key = $this_network."_link2_mac_to_set";
my $say_network = $anvil->Words->string({key => "striker_0018", variables => { number => $i }});
if ($network eq "sn") if ($network eq "sn")
{ {
$say_network = $anvil->Words->string({key => "striker_0020", variables => { number => $i }}); $say_network = $anvil->Words->string({key => "striker_0020", variables => { number => $i }});
@ -819,19 +885,19 @@ sub process_prep_network
foreach my $interface (sort {$a cmp $b} keys %{$anvil->data->{json}{all_status}{hosts}{$host_name}{network_interface}{interface}}) foreach my $interface (sort {$a cmp $b} keys %{$anvil->data->{json}{all_status}{hosts}{$host_name}{network_interface}{interface}})
{ {
my $mac_address = $anvil->data->{json}{all_status}{hosts}{$host_name}{network_interface}{interface}{$interface}{mac_address}; my $mac_address = $anvil->data->{json}{all_status}{hosts}{$host_name}{network_interface}{interface}{$interface}{mac_address};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
interface => $interface, interface => $interface,
mac_address => $mac_address, mac_address => $mac_address,
}}); }});
if ($mac_address eq $anvil->data->{cgi}{$link1_key}{value}) if ($mac_address eq $anvil->data->{cgi}{$link1_key}{value})
{ {
$link1_interface = $interface; $link1_interface = $interface;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { link1_interface => $link1_interface }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { link1_interface => $link1_interface }});
} }
elsif ($mac_address eq $anvil->data->{cgi}{$link2_key}{value}) elsif ($mac_address eq $anvil->data->{cgi}{$link2_key}{value})
{ {
$link2_interface = $interface; $link2_interface = $interface;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { link2_interface => $link2_interface }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { link2_interface => $link2_interface }});
} }
last if (($link1_interface) && ($link2_interface)); last if (($link1_interface) && ($link2_interface));
} }
@ -842,12 +908,13 @@ sub process_prep_network
$say_bridge = "#!string!unit_0001!#"; $say_bridge = "#!string!unit_0001!#";
} }
my $say_ip_address = "#!string!striker_0152!#"; my $say_ip_address = "#!string!striker_0152!#";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { say_ip_address => $say_ip_address }});
if (($anvil->data->{cgi}{$ip_key}{value}) && (not $anvil->Validate->is_ipv4({ip => $anvil->data->{cgi}{$ip_key}{value}}))) if (($anvil->data->{cgi}{$ip_key}{value}) && (not $anvil->Validate->is_ipv4({ip => $anvil->data->{cgi}{$ip_key}{value}})))
{ {
# Bad IP # Bad IP
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "warning_0010", variables => { ip_address => $anvil->data->{cgi}{$ip_key}{value} }}) }}); $anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "warning_0010", variables => { ip_address => $anvil->data->{cgi}{$ip_key}{value} }}) }});
$anvil->data->{cgi}{$ip_key}{alert} = 1; $anvil->data->{cgi}{$ip_key}{alert} = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
"form::error_massage" => $anvil->data->{form}{error_massage}, "form::error_massage" => $anvil->data->{form}{error_massage},
"cgi::${ip_key}::alert" => $anvil->data->{cgi}{$ip_key}{alert}, "cgi::${ip_key}::alert" => $anvil->data->{cgi}{$ip_key}{alert},
}}); }});
@ -857,7 +924,7 @@ sub process_prep_network
# Bad subnet # Bad subnet
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "warning_0017"}) }}); $anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "warning_0017"}) }});
$anvil->data->{cgi}{$subnet_key}{alert} = 1; $anvil->data->{cgi}{$subnet_key}{alert} = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
"form::error_massage" => $anvil->data->{form}{error_massage}, "form::error_massage" => $anvil->data->{form}{error_massage},
"cgi::${subnet_key}::alert" => $anvil->data->{cgi}{$subnet_key}{alert}, "cgi::${subnet_key}::alert" => $anvil->data->{cgi}{$subnet_key}{alert},
}}); }});
@ -867,20 +934,49 @@ sub process_prep_network
# IP without a subnet # IP without a subnet
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "warning_0018"}) }}); $anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "warning_0018"}) }});
$anvil->data->{cgi}{$subnet_key}{alert} = 1; $anvil->data->{cgi}{$subnet_key}{alert} = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
"form::error_massage" => $anvil->data->{form}{error_massage}, "form::error_massage" => $anvil->data->{form}{error_massage},
"cgi::${subnet_key}::alert" => $anvil->data->{cgi}{$subnet_key}{alert}, "cgi::${subnet_key}::alert" => $anvil->data->{cgi}{$subnet_key}{alert},
}}); }});
} }
else else
{ {
$say_ip_address = $anvil->data->{cgi}{$ip_key}{value}."/".$anvil->data->{cgi}{$subnet_key}{value}; ### Things are sane.
# Does this network have an IP or is it dhcp?
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { "cgi::${ip_key}::value" => $anvil->data->{cgi}{$ip_key}{value} }});
if ($anvil->data->{cgi}{$ip_key}{value})
{
$say_ip_address = $anvil->data->{cgi}{$ip_key}{value}."/".$anvil->data->{cgi}{$subnet_key}{value};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { say_ip_address => $say_ip_address }});
$anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step2::".$ip_key."::value",
variable_value => $anvil->data->{cgi}{$ip_key}{value},
variable_default => "",
variable_description => "striker_0153,!!say_network!".$say_network."!!",
variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts",
update_value_only => 1,
});
$anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step2::".$subnet_key."::value",
variable_value => $anvil->data->{cgi}{$subnet_key}{value},
variable_default => "",
variable_description => "striker_0154,!!say_network!".$say_network."!!",
variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts",
update_value_only => 1,
});
}
# Is this the network with the subnet mask? # Is this the network with the subnet mask?
if ((not $gateway_interface) && if ((not $gateway_interface) &&
($anvil->data->{cgi}{gateway}{value}) && ($anvil->data->{cgi}{gateway}{value}) &&
(not $anvil->data->{cgi}{gateway}{alert}) && (not $anvil->data->{cgi}{gateway}{alert}) &&
($anvil->data->{cgi}{$ip_key}{value})) ($anvil->data->{cgi}{$ip_key}{value}))
{ {
my $match = $anvil->Network->match_gateway({ my $match = $anvil->Network->match_gateway({
ip_address => $anvil->data->{cgi}{$ip_key}{value}, ip_address => $anvil->data->{cgi}{$ip_key}{value},
@ -889,49 +985,180 @@ sub process_prep_network
}); });
# Found the match! # Found the match!
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { match => $match }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { match => $match }});
if ($match) if ($match)
{ {
$say_ip_address .= ", #!string!striker_0026!#: ".$anvil->data->{cgi}{$bridge_key}{value}; if ($anvil->data->{cgi}{$ip_key}{value})
# DNS?
if (($anvil->data->{cgi}{dns}{value}) && (not $anvil->data->{cgi}{dns}{alert}))
{ {
$say_ip_address .= ", #!string!striker_0037!#: ".$anvil->data->{cgi}{dns}{value}; $say_ip_address .= ",<br /> &nbsp; #!string!striker_0026!#: ".$anvil->data->{cgi}{gateway}{value};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { say_ip_address => $say_ip_address }});
} }
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "cgi::${bridge_key}::value" => $anvil->data->{cgi}{$bridge_key}{value} }});
if ($anvil->data->{cgi}{$bridge_key}{value}) # DNS?
{ if (($anvil->data->{cgi}{dns}{value}) && (not $anvil->data->{cgi}{dns}{alert}) && ($anvil->data->{cgi}{$ip_key}{value}))
$gateway_interface = $network.$i."_bridge1";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { gateway_interface => $gateway_interface }});
}
else
{ {
$gateway_interface = $network.$i."_bond1"; $say_ip_address .= ",<br /> &nbsp; #!string!striker_0037!#: ".$anvil->data->{cgi}{dns}{value};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { gateway_interface => $gateway_interface }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { say_ip_address => $say_ip_address }});
} }
$gateway_interface = $this_network;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { gateway_interface => $gateway_interface }});
$anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step2::gateway_interface::value",
variable_value => $gateway_interface,
variable_default => "",
variable_description => "striker_0155",
variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts",
update_value_only => 1,
});
} }
} }
} }
if (not $anvil->data->{cgi}{$ip_key}{value})
{
# Record this as DHCP.
$anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step2::".$ip_key."::value",
variable_value => "dhcp",
variable_default => "",
variable_description => "striker_0160",
variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts",
update_value_only => 1,
});
}
# Last check, are the interfaces defined? All $i == 1 interfaces need to be
# defined. Any 2+ are allowed to be ignored, _IF_ neither link is selected
# AND neither the IP/subnet are blank.
if ((not $anvil->data->{cgi}{$link1_key}{value}) && (not $anvil->data->{cgi}{$link2_key}{value}))
{
# If this is network 1, both are required.
if ($i == 1)
{
# Required.
my $error_message = $anvil->Words->string({key => "warning_0021"});
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $error_message }});
$anvil->data->{cgi}{$link1_key}{value} = 1;
$anvil->data->{cgi}{$link2_key}{value} = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
"form::error_massage" => $anvil->data->{form}{error_massage},
"cgi::${link1_key}::alert" => $anvil->data->{cgi}{$link1_key}{alert},
"cgi::${link2_key}::alert" => $anvil->data->{cgi}{$link2_key}{alert},
}});
}
}
elsif (not $anvil->data->{cgi}{$link1_key}{value})
{
# link 1 is missing.
my $error_message = $anvil->Words->string({key => "warning_0022"});
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $error_message }});
$anvil->data->{cgi}{$link1_key}{value} = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
"form::error_massage" => $anvil->data->{form}{error_massage},
"cgi::${link1_key}::alert" => $anvil->data->{cgi}{$link1_key}{alert},
}});
}
elsif (not $anvil->data->{cgi}{$link2_key}{value})
{
# link 2 is missing.
my $error_message = $anvil->Words->string({key => "warning_0022"});
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $error_message }});
$anvil->data->{cgi}{$link2_key}{value} = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
"form::error_massage" => $anvil->data->{form}{error_massage},
"cgi::${link2_key}::alert" => $anvil->data->{cgi}{$link2_key}{alert},
}});
}
elsif (($anvil->data->{cgi}{$ip_key}{value}) && (not $anvil->data->{cgi}{$link1_key}{value}))
{
# There's an IP address but no interfaces selected.
my $error_message = $anvil->Words->string({key => "warning_0022"});
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $error_message }});
$anvil->data->{cgi}{$link1_key}{value} = 1;
$anvil->data->{cgi}{$link2_key}{value} = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
"form::error_massage" => $anvil->data->{form}{error_massage},
"cgi::${link1_key}::alert" => $anvil->data->{cgi}{$link1_key}{alert},
"cgi::${link2_key}::alert" => $anvil->data->{cgi}{$link2_key}{alert},
}});
}
# Now save the link info, if selected.
if ($anvil->data->{cgi}{$link1_key}{value})
{
$anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step2::".$link1_key."::value",
variable_value => $anvil->data->{cgi}{$link1_key}{value},
variable_default => "",
variable_description => "striker_0156",
variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts",
update_value_only => 1,
});
}
if ($anvil->data->{cgi}{$link2_key}{value})
{
$anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step2::".$link2_key."::value",
variable_value => $anvil->data->{cgi}{$link2_key}{value},
variable_default => "",
variable_description => "striker_0157",
variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts",
update_value_only => 1,
});
}
# Store the bridge key
$anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step2::".$bridge_key."::value",
variable_value => $anvil->data->{cgi}{$bridge_key}{value},
variable_default => "",
variable_description => "striker_0158",
variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts",
update_value_only => 1,
});
$interfaces .= $anvil->Template->get({file => "anvil.html", name => "interface-entry", variables => { $interfaces .= $anvil->Template->get({file => "anvil.html", name => "interface-entry", variables => {
network => $say_network, network => $say_network,
primary => $link1_interface." (".$anvil->data->{cgi}{$link1_key}{value}.")", primary => $link1_interface." (".$anvil->data->{cgi}{$link1_key}{value}.")",
link1_key => $link1_key, link1_key => $link1_key,
link1_value => $anvil->data->{cgi}{$link1_key}{value}, link1_value => $anvil->data->{cgi}{$link1_key}{value},
secondary => $link2_interface." (".$anvil->data->{cgi}{$link2_key}{value}.")", secondary => $link2_interface." (".$anvil->data->{cgi}{$link2_key}{value}.")",
link2_key => $link2_key, link2_key => $link2_key,
link2_value => $anvil->data->{cgi}{$link2_key}{value}, link2_value => $anvil->data->{cgi}{$link2_key}{value},
bridge => $say_bridge, bridge => $say_bridge,
say_ip => $say_ip_address,
ip_key => $ip_key,
ip_address => $anvil->data->{cgi}{$ip_key}{value},
subnet_key => $subnet_key,
subnet_mask => $anvil->data->{cgi}{$subnet_key}{value},
bridge_key => $bridge_key,
bridge_value => $anvil->data->{cgi}{$bridge_key}{value},
}}); }});
} }
} }
# Did we see an error? # Did we see an error?
if ($anvil->data->{form}{error_massage}) if ($anvil->data->{form}{error_massage})
{ {
# Yup, not sane, send the user back to the form.
$sane = 0; $sane = 0;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { sane => $sane }});
} }
# Confirmed? # Confirmed?
@ -939,31 +1166,7 @@ sub process_prep_network
if (($anvil->data->{cgi}{confirm}{value}) && ($sane)) if (($anvil->data->{cgi}{confirm}{value}) && ($sane))
{ {
# Yes, save the job. # Yes, save the job.
=cut
2019/12/05 20:43:15:Get.pm:394; cgi::next::value ............... : [Next]
2019/12/05 20:43:15:Get.pm:394; cgi::step::value ............... : [step2]
variable_name | variable_value
--------------------------------------------------+-------------------------
form::config_step2::hostname::value | m3-striker01.digimer.ca
form::config_step2::dns::value | 8.8.8.8, 8.8.4.4
form::config_step2::ifn1_link1_mac_to_set::value | 52:54:00:9d:91:8a
form::config_step2::gateway_interface::value | ifn1
form::config_step2::striker_user::value | admin
form::config_step2::ifn1_subnet::value | 255.255.0.0
form::config_step2::bcn1_link1_mac_to_set::value | 52:54:00:8b:a0:a3
form::config_step2::gateway::value | 10.255.255.254
form::config_step2::ifn1_ip::value | 10.255.14.1
form::config_step2::bcn1_ip::value | 10.20.14.1
form::config_step2::bcn1_subnet::value | 255.255.0.0
form::config_step2::striker_password::value | super secret password
form::config_step1::organization::value | Madison Kelly
form::config_step1::sequence::value | 1
form::config_step1::domain::value | digimer.ca
form::config_step1::prefix::value | m3
form::config_step1::ifn_count::value | 1
=cut
} }
else else
{ {
@ -971,9 +1174,10 @@ sub process_prep_network
$anvil->data->{form}{back_link} = $anvil->data->{sys}{cgi_string}; $anvil->data->{form}{back_link} = $anvil->data->{sys}{cgi_string};
$anvil->data->{form}{back_link} =~ s/step=step2//; $anvil->data->{form}{back_link} =~ s/step=step2//;
$anvil->data->{form}{body} = $anvil->Template->get({file => "anvil.html", name => "config-network-confirm", variables => { $anvil->data->{form}{body} = $anvil->Template->get({file => "anvil.html", name => "config-network-confirm", variables => {
host_name => $host_name, host_name => $host_name,
host_uuid => $anvil->data->{cgi}{host_uuid}{value}, host_uuid => $anvil->data->{cgi}{host_uuid}{value},
interfaces => $interfaces, gateway_interface => $gateway_interface,
interfaces => $interfaces,
}}); }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { 'form::body' => $anvil->data->{form}{body} }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { 'form::body' => $anvil->data->{form}{body} }});
return(0); return(0);

@ -193,9 +193,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2" class="column_row_value_right">
<br />
<hr>
<input type="submit" name="next" id="next" class="button" value="#!string!striker_0013!#"> <input type="submit" name="next" id="next" class="button" value="#!string!striker_0013!#">
</td> </td>
</tr> </tr>
@ -216,7 +214,7 @@
<!-- end config-network-main --> <!-- end config-network-main -->
<!-- start config-network-confirm --> <!-- start config-network-confirm -->
<table align="center" class="anvil_main_menu"> <table align="center" width="75%">
<tr> <tr>
<td colspan="2"> <td colspan="2">
&nbsp; &nbsp;
@ -243,107 +241,106 @@
<hr> <hr>
</td> </td>
</tr> </tr>
<form name="network_config_confirm" action="" method="post">
<tr>
<td>
#!string!striker_0016!#
</td>
<td>
#!variable!host_name!#
</td>
</tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<table width="100%"> <table class="centered">
<form name="network_config_confirm" action="" method="post">
<div id="network_plan"> <div id="network_plan">
<tr> <tr>
<td width="75%" style="vertical-align: top;"> <td colspan="2">
<table> <!-- Network Plan -->
<tr> #!string!striker_0148!#
<td colspan="5"> </td>
<!-- Network Plan --> </tr>
#!string!striker_0148!# <tr>
</td> <td colspan="2" style="vertical-align: top;">
</tr> <table class="data_table_nowrap">
<tr> <tr>
<td> <td class="column_header">
<!-- Network Name --> <!-- Network Name -->
#!string!striker_0149!# #!string!striker_0149!# &nbsp;
</td> </td>
<td> <td class="column_header">
<!-- Primary Interface --> <!-- Primary Interface -->
#!string!striker_0029!# &nbsp; #!string!striker_0029!# &nbsp;
</td> </td>
<td> <td class="column_header">
<!-- Secondary Interface --> <!-- Secondary Interface -->
#!string!striker_0030!# &nbsp; #!string!striker_0030!# &nbsp;
</td> </td>
<td> <td class="column_header">
<!-- Primary IP Address/Subnet (or DHCP) --> <!-- Primary IP Address/Subnet (or DHCP) -->
#!string!striker_0150!# &nbsp; #!string!striker_0150!# &nbsp;
</td> </td>
<td> <td class="column_header">
<!-- Bridge? --> <!-- Bridge? -->
#!string!striker_0151!# &nbsp; #!string!striker_0151!#
</td>
</tr>
#!variable!interfaces!#
<tr>
<td class="column_header">
#!string!striker_0016!#:
</td>
<td colspan="4" class="column_row_value_fixed">
&nbsp; #!variable!host_name!#
</td> </td>
</tr> </tr>
#!variable!interfaces!#
</table> </table>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td class="column_row_value">
<br /> <br />
<hr> <input type="submit" name="back" id="back" class="button" value="#!string!striker_0098!#">
<input type="button" name="back" id="back" class="button" value="#!string!striker_0098!#">
</td> </td>
<td> <td class="column_row_value_right">
<br /> <br />
<hr>
<input type="submit" name="confirm" id="confirm" class="button" value="#!string!striker_0082!#"> <input type="submit" name="confirm" id="confirm" class="button" value="#!string!striker_0082!#">
</td> </td>
</tr> </tr>
<input type="hidden" name="host_uuid" id="host_uuid" value="#!variable!host_uuid!#"> <input type="hidden" name="host_uuid" id="host_uuid" value="#!variable!host_uuid!#">
<input type="hidden" name="bcn_count" id="bcn_count" value="#!variable!bcn_count!#"> <input type="hidden" name="bcn_count" id="bcn_count" value="#!variable!bcn_count!#">
<input type="hidden" name="sn_count" id="sn_count" value="#!variable!sn_count!#"> <input type="hidden" name="sn_count" id="sn_count" value="#!variable!sn_count!#">
<input type="hidden" name="ifn_count" id="ifn_count" value="#!variable!ifn_count!#"> <input type="hidden" name="ifn_count" id="ifn_count" value="#!variable!ifn_count!#">
<input type="hidden" name="save" id="save" value="true"> <input type="hidden" name="gateway_interface" id="gateway_interface" value="#!variable!gateway_interface!#">
<input type="hidden" name="anvil" id="anvil" value="true"> <input type="hidden" name="save" id="save" value="true">
<input type="hidden" name="task" id="task" value="prep-network"> <input type="hidden" name="anvil" id="anvil" value="true">
<input type="hidden" name="task" id="task" value="prep-network">
</form> </form>
</div> </div>
</table> </table>
</td> </td>
</tr> </tr>
</form>
</table> </table>
<!-- end config-network-confirm --> <!-- end config-network-confirm -->
<!-- start interface-entry --> <!-- start interface-entry -->
<tr> <tr>
<td> <td class="column_row_value">
<!-- Network Name --> <!-- Network Name -->
#!variable!network!# #!variable!network!# &nbsp;
<input type="hidden" id="#!variable!network!#_network" value="#!variable!network!#" />
</td> </td>
<td> <td class="column_row_value_fixed">
<!-- Primary Interface --> <!-- Primary Interface -->
#!variable!primary!# &nbsp; #!variable!primary!# &nbsp;
<input type="hidden" id="#!variable!link1_key!#" value="#!variable!link1_value!#" /> <input type="hidden" name="#!variable!link1_key!#" id="#!variable!link1_key!#" value="#!variable!link1_value!#" />
</td> </td>
<td> <td class="column_row_value_fixed">
<!-- Secondary Interface --> <!-- Secondary Interface -->
#!variable!secondary!# &nbsp; #!variable!secondary!# &nbsp;
<input type="hidden" id="#!variable!link2_key!#" value="#!variable!link2_value!#" /> <input type="hidden" name="#!variable!link2_key!#" id="#!variable!link2_key!#" value="#!variable!link2_value!#" />
</td> </td>
<td> <td class="column_row_value_fixed">
<!-- Primary IP Address/Subnet (or DHCP) --> <!-- Primary IP Address/Subnet (or DHCP) -->
#!variable!ip_address!# &nbsp; #!variable!say_ip!# &nbsp;
<input type="hidden" id="#!variable!link2_key!#" value="#!variable!link2_value!#" /> <input type="hidden" name="#!variable!ip_key!#" id="#!variable!ip_key!#" value="#!variable!ip_address!#" />
<input type="hidden" name="#!variable!subnet_key!#" id="#!variable!subnet_key!#" value="#!variable!subnet_mask!#" />
</td> </td>
<td> <td class="column_row_value">
<!-- Bridge? --> <!-- Bridge? -->
#!variable!bridge!# &nbsp; #!variable!bridge!#
<input type="hidden" name="#!variable!bridge_key!#" id="#!variable!bridge_key!#" value="#!variable!bridge_value!#" />
</td> </td>
</tr> </tr>
<!-- end interface-entry --> <!-- end interface-entry -->

@ -293,6 +293,11 @@ table.data_table_nowrap {
white-space: nowrap; white-space: nowrap;
} }
table.centered {
margin-left: auto;
margin-right: auto;
}
td { td {
padding: 0; padding: 0;
border-collapse: collapse; border-collapse: collapse;
@ -317,17 +322,25 @@ td.column_row_name {
} }
td.column_row_value { td.column_row_value {
text-align: left; text-align: left;
color: #f7f7f7;
padding: 0.2em;
vertical-align: top;
}
td.column_row_value_right {
text-align: right;
color: #f7f7f7; color: #f7f7f7;
padding: 0.2em; padding: 0.2em;
} }
td.column_row_value_fixed { td.column_row_value_fixed {
text-align: left; text-align: left;
color: #f7f7f7; color: #f7f7f7;
font-family: 'Dejavu Sans Mono', Courier; font-family: 'Dejavu Sans Mono', Courier;
padding: 0.2em; padding: 0.2em;
font-size: 0.9em; font-size: 0.9em;
vertical-align: top;
} }
td.column_row_value_fixed_centered { td.column_row_value_fixed_centered {

@ -60,9 +60,9 @@ y = Device Type.
1. Switches 1. Switches
2. PDUs 2. PDUs
3. UPSes 3. UPSes
4. Switches 4. Strikers
5. Strikers 5. Striker IPMI (BCN only)
6. Striker IPMI (BCN only)
Anvil! systems; Anvil! systems;
1st - 10 = Node IP 1st - 10 = Node IP
11 = Node IPMI 11 = Node IPMI
@ -74,7 +74,7 @@ y = Device Type.
z = Device Sequence z = Device Sequence
- Foundation pack devices are simple sequence - Foundation pack devices are simple sequence
- Anvils; .1 = node 1, .2 = node 2 - Anvils; .1 = node 1, .2 = node 2, .3 = dr
==== ====

@ -997,7 +997,15 @@ If you are comfortable that the target has changed for a known reason, you can s
<key name="striker_0149">Network</key> <key name="striker_0149">Network</key>
<key name="striker_0150">Address</key> <key name="striker_0150">Address</key>
<key name="striker_0151">Bridged?</key> <key name="striker_0151">Bridged?</key>
<key name="striker_0152"><![CDATA[<dhcp>]]></key> <key name="striker_0152"><![CDATA[<span class="notice">dhcp</span>]]></key>
<key name="striker_0153">IP address for: [#!variable!say_network!#]</key>
<key name="striker_0154">Subnet mask for: [#!variable!say_network!#]</key>
<key name="striker_0155">The network interface that connects to the default gateway.</key>
<key name="striker_0156">This is the primary network interface. All things being equal, this is the interface that network traffic will travel over.</key>
<key name="striker_0157">This is the secondary network interface. Network traffic will switch over to this interface if there is a problem detected with the primary interface.</key>
<key name="striker_0158">If set, a bridge will be created on this network, allowing hosted servers to use this network.</key>
<key name="striker_0159">This is the host name for the target system.</key>
<key name="striker_0160">The network will use DHCP to attempt to get an IP address.</key>
<!-- These are generally units and appended to numbers --> <!-- These are generally units and appended to numbers -->
<key name="suffix_0001">#!variable!number!#/sec</key> <key name="suffix_0001">#!variable!number!#/sec</key>
@ -1161,6 +1169,8 @@ Failure! The return code: [#!variable!return_code!#] was received ('0' was expec
<key name="warning_0018">The IP address was specified, but the subnet mask was not</key> <key name="warning_0018">The IP address was specified, but the subnet mask was not</key>
<key name="warning_0019">The passed in parameter '#!variable!parameter!#': [#!variable!ip_address!#] is not a valid IPv4 address.</key> <key name="warning_0019">The passed in parameter '#!variable!parameter!#': [#!variable!ip_address!#] is not a valid IPv4 address.</key>
<key name="warning_0020">The passed in parameter '#!variable!parameter!#': [#!variable!subnet_mask!#] is not a valid IPv4 subnet mask.</key> <key name="warning_0020">The passed in parameter '#!variable!parameter!#': [#!variable!subnet_mask!#] is not a valid IPv4 subnet mask.</key>
<key name="warning_0021">All three networks require the first network pair to be defined.</key>
<key name="warning_0022">Only one network interface selected for a network pair.</key>
<!-- Errors --> <!-- Errors -->
<key name="error_0001">There are not enough network interfaces on this machine. You have: [#!variable!interface_count!#] interface(s), and you need at least: [#!variable!required_interfaces_for_single!#] interfaces to connect to the requested networks (one for Back-Channel and one for each Internet-Facing network).</key> <key name="error_0001">There are not enough network interfaces on this machine. You have: [#!variable!interface_count!#] interface(s), and you need at least: [#!variable!required_interfaces_for_single!#] interfaces to connect to the requested networks (one for Back-Channel and one for each Internet-Facing network).</key>

Loading…
Cancel
Save