* Updated striker to only require 6 interfaces when configuring a node.

Signed-off-by: digimer <digimer@gravitar.alteeve.com>
main
digimer 2 years ago
parent 0fa6ddebc5
commit b27a43eaf7
  1. 17
      cgi-bin/striker
  2. 2
      share/words.xml

@ -5356,10 +5356,13 @@ sub process_prep_network
process_anvil_menu($anvil); process_anvil_menu($anvil);
return(0); return(0);
} }
my $host_uuid = $anvil->data->{cgi}{host_uuid}{value};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { host_uuid => $host_uuid }});
# Pull the host's data out of the JSON file. # Pull the host's data out of the JSON file.
$anvil->Striker->parse_all_status_json(); $anvil->Striker->parse_all_status_json();
my $host_type = "";
my $host_name = ""; my $host_name = "";
foreach my $host (sort {$a cmp $b} keys %{$anvil->data->{json}{all_status}{hosts}}) foreach my $host (sort {$a cmp $b} keys %{$anvil->data->{json}{all_status}{hosts}})
{ {
@ -5371,7 +5374,11 @@ sub process_prep_network
{ {
# Found it. # Found it.
$host_name = $host; $host_name = $host;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { host_name => $host_name }}); $host_type = $anvil->data->{hosts}{host_uuid}{$host_uuid}{host_type};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
host_name => $host_name,
host_type => $host_type,
}});
last; last;
} }
} }
@ -5404,7 +5411,7 @@ 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}})
{ {
# if any interfaces are called 'virbrX-nic', ignore it as it will be removed. Likewise, ignore any 'vnetX' devices. # if any interfaces are called 'virbrX-nic', ignore it as it will be removed. Likewise, ignore any 'vnetX' devices.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { interface => $interface }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { interface => $interface }});
if (($interface =~ /^virbr\d+-nic/) or ($interface =~ /^vnet\d+/)) if (($interface =~ /^virbr\d+-nic/) or ($interface =~ /^vnet\d+/))
{ {
# Ignore it. # Ignore it.
@ -5417,14 +5424,14 @@ sub process_prep_network
# Store the mac address . # Store the mac address .
$interfaces->{$interface} = $mac_address; $interfaces->{$interface} = $mac_address;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { "interfaces->{".$interface."}" => $interfaces->{$interface} }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "interfaces->{".$interface."}" => $interfaces->{$interface} }});
} }
# Get the interface count # Get the interface count
my $interface_count = keys %{$interfaces}; my $interface_count = keys %{$interfaces};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { interface_count => $interface_count }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { interface_count => $interface_count }});
if ($interface_count < 6) if (($host_type eq "node") && ($interface_count < 6))
{ {
# Not enough interfaces. # Not enough interfaces.
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "warning_0015", variables => { interface_count => $interface_count } }) }}); $anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "warning_0015", variables => { interface_count => $interface_count } }) }});

@ -3313,7 +3313,7 @@ Here we will inject 't_0006', which injects 't_0001' which has a variable: [#!st
<key name="warning_0012">[ Warning ] - Failed to log into the host. Is the IP or root user's password right?</key> <key name="warning_0012">[ Warning ] - Failed to log into the host. Is the IP or root user's password right?</key>
<key name="warning_0013"><![CDATA[[ Warning ] - The target's host key has changed. If the target has been rebuilt, or the target IP reused, the old key will need to be removed. <a href="?striker=true&task=keys" target="_new">Click here</a> to resolve.]]></key> <key name="warning_0013"><![CDATA[[ Warning ] - The target's host key has changed. If the target has been rebuilt, or the target IP reused, the old key will need to be removed. <a href="?striker=true&task=keys" target="_new">Click here</a> to resolve.]]></key>
<key name="warning_0014">[ Warning ] - The host UUID: [#!variable!host_uuid!#] was not found in the #!data!path::json::all_status!# file on the local dashboard.</key> <key name="warning_0014">[ Warning ] - The host UUID: [#!variable!host_uuid!#] was not found in the #!data!path::json::all_status!# file on the local dashboard.</key>
<key name="warning_0015">[ Warning ] - To configure a host as either an #!string!brand_0002!# node or a disaster recovery host, there must be at least 6 network interfaces. This machine only has: [#!variable!interface_count!#] interfaces.</key> <key name="warning_0015">[ Warning ] - To configure a #!string!brand_0002!# sub-node, there must be at least 6 network interfaces. This machine only has: [#!variable!interface_count!#] interfaces.</key>
<key name="warning_0016">[ Warning ] - No databases are available. Changes to the network interfaces will be cached.</key> <key name="warning_0016">[ Warning ] - No databases are available. Changes to the network interfaces will be cached.</key>
<key name="warning_0017">[ Warning ] - The subnet mask is not valid</key> <key name="warning_0017">[ Warning ] - The subnet mask is not valid</key>
<key name="warning_0018">[ Warning ] - The IP address was specified, but the subnet mask was not</key> <key name="warning_0018">[ Warning ] - The IP address was specified, but the subnet mask was not</key>

Loading…
Cancel
Save