* Fixed a resync bug where bridges needed to sync before bonds

* Re-enabled user-selected BCN subnet ranges (needs more testing).

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 4 years ago
parent 49682a01d7
commit 82acb4e104
  1. 2
      Anvil/Tools.pm
  2. 12
      cgi-bin/striker
  3. 4
      rpm/SPECS/anvil.spec
  4. 13
      tools/anvil-daemon
  5. 16
      tools/striker-initialize-host

@ -908,8 +908,8 @@ sub _set_defaults
"mail_servers", "mail_servers",
"variables", "variables",
"jobs", "jobs",
"bonds",
"bridges", "bridges",
"bonds",
"network_interfaces", "network_interfaces",
"ip_addresses", "ip_addresses",
"files", "files",

@ -2587,12 +2587,22 @@ sub handle_manifest
"cgi::${gateway_key}::alert" => $anvil->data->{cgi}{$gateway_key}{alert}, "cgi::${gateway_key}::alert" => $anvil->data->{cgi}{$gateway_key}{alert},
}}); }});
my $select = $anvil->Template->select_form({
name => $subnet_key,
options => "subnet",
blank => 0,
'sort' => 0,
selected => $anvil->data->{cgi}{$subnet_key}{value},
class => $anvil->data->{cgi}{$subnet_key}{alert} ? "input_alert" : "input_clear",
style => "width: 15em;",
});
$network_form .= $anvil->Template->get({file => "anvil.html", name => "manifest-step2-network-entry", variables => { $network_form .= $anvil->Template->get({file => "anvil.html", name => "manifest-step2-network-entry", variables => {
network => $say_bcn, network => $say_bcn,
network_name => $network_key, network_name => $network_key,
network_class => $anvil->data->{cgi}{$network_key}{alert} ? "input_alert" : "", network_class => $anvil->data->{cgi}{$network_key}{alert} ? "input_alert" : "",
network_value => $anvil->data->{cgi}{$network_key}{value}, network_value => $anvil->data->{cgi}{$network_key}{value},
subnet => '255.255.0.0 <input type="hidden" name="'.$subnet_key.'" id="'.$subnet_key.'" value="'.$anvil->data->{cgi}{$subnet_key}{value}.'" />', subnet => $select,
}}); }});
} }

@ -76,6 +76,7 @@ Requires: postfix
Requires: postgresql-contrib Requires: postgresql-contrib
Requires: postgresql-plperl Requires: postgresql-plperl
Requires: rsync Requires: rsync
Requires: screen
Requires: syslinux Requires: syslinux
Requires: tmux Requires: tmux
Requires: usbutils Requires: usbutils
@ -373,7 +374,8 @@ fi
%changelog %changelog
* tbd Madison Kelly <mkelly@alteeve.ca> 3.0-35 * Thu Sep 03 2020 Madison Kelly <mkelly@alteeve.ca> 3.0-35
- Added screen as a core module dependency
- Updated source. - Updated source.
* Fri Aug 28 2020 Madison Kelly <mkelly@alteeve.ca> 3.0-34 * Fri Aug 28 2020 Madison Kelly <mkelly@alteeve.ca> 3.0-34

@ -1056,19 +1056,10 @@ sub update_state_file
{ {
my ($anvil) = @_; my ($anvil) = @_;
# Bunch of things happen here, so this allows a single variable to change for logging.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0480"}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0480"});
my $log_level = 2;
my $v = "-";
for (1..$log_level)
{
$v .= "v";
}
my $shell_call = $anvil->data->{path}{exe}{'anvil-update-states'}." ".$v;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { shell_call => $shell_call }});
my ($states_output, $return_code) = $anvil->System->call({debug => $log_level, shell_call => $shell_call, source => $THIS_FILE, line => __LINE__}); my ($states_output, $return_code) = $anvil->System->call({debug => 3, shell_call => $anvil->data->{path}{exe}{'anvil-update-states'}." -v", source => $THIS_FILE, line => __LINE__});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
states_output => $states_output, states_output => $states_output,
return_code => $return_code, return_code => $return_code,
}}); }});

@ -134,11 +134,14 @@ sub add_databases
# possible at this stage that the target doesn't have a BCN IP. So we need to figure out what IP it # possible at this stage that the target doesn't have a BCN IP. So we need to figure out what IP it
# has and we have that are on the same subnet. # has and we have that are on the same subnet.
# Scan our network and the target's network, then compare them. # Scan our network and the target's network, then compare them.
$anvil->data->{job}{progress} += 5; update_progress($anvil, ($anvil->data->{job}{progress} += 5), "job_0046");
update_progress($anvil, $anvil->data->{job}{progress}, "job_0046");
my $target = $anvil->data->{data}{host_ip_address}; my $target = $anvil->data->{data}{host_ip_address};
$anvil->Network->get_ips(); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { target => $target }});
$anvil->Network->get_ips({debug => 3});
$anvil->Network->get_ips({ $anvil->Network->get_ips({
debug => 3,
target => $target, target => $target,
remote_user => "root", remote_user => "root",
password => $anvil->data->{data}{password}, password => $anvil->data->{data}{password},
@ -150,6 +153,7 @@ sub add_databases
first => $local_host, first => $local_host,
second => $target, second => $target,
}); });
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { match => $match }});
# We'll sort in reverse order, so if there is a BCN address, we'll use it. # We'll sort in reverse order, so if there is a BCN address, we'll use it.
my $host_uuid = $anvil->data->{sys}{host_uuid}; my $host_uuid = $anvil->data->{sys}{host_uuid};
@ -204,7 +208,7 @@ sub add_databases
else else
{ {
# Success! We're done! # Success! We're done!
update_progress($anvil, 100, "job_0047"); update_progress($anvil, $anvil->data->{job}{progress} += 5, "job_0047");
} }
} }
else else
@ -227,8 +231,7 @@ sub add_databases
$target_host = $target if not $target_host; $target_host = $target if not $target_host;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { target_host => $target_host }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { target_host => $target_host }});
$anvil->data->{job}{progress} += 2; update_progress($anvil, ($anvil->data->{job}{progress} += 2), "job_0068,!!host_name!".$target_host."!!");
update_progress($anvil, $anvil->data->{job}{progress}, "job_0068,!!host_name!".$target_host."!!");
# This is a peer. # This is a peer.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
@ -259,6 +262,7 @@ sub add_databases
first => $target, first => $target,
second => $uuid, second => $uuid,
}); });
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { match => $match }});
# Did we find a match? # Did we find a match?
if ($match) if ($match)

Loading…
Cancel
Save