Merge pull request #45 from ClusterLabs/auto-build-anvil

Auto build anvil
main
digimer-bot 4 years ago committed by GitHub
commit 560c8da4c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      Anvil/Tools.pm
  2. 74
      Anvil/Tools/Database.pm
  3. 2
      Anvil/Tools/Get.pm
  4. 2
      Anvil/Tools/Job.pm
  5. 25
      Anvil/Tools/Network.pm
  6. 28
      Anvil/Tools/Remote.pm
  7. 4
      Anvil/Tools/Striker.pm
  8. 22
      cgi-bin/striker
  9. 4
      notes
  10. 50
      share/words.xml
  11. 33
      tools/anvil-daemon
  12. 1490
      tools/striker-auto-initialize-all
  13. 160
      tools/striker-auto-initialize-all.example

@ -1189,6 +1189,7 @@ sub _set_paths
stonith_admin => "/usr/sbin/stonith_admin",
storcli64 => "/opt/MegaRAID/storcli/storcli64",
strings => "/usr/bin/strings",
'striker-auto-initialize-all' => "/usr/sbin/striker-auto-initialize-all",
'striker-get-peer-data' => "/usr/sbin/striker-get-peer-data",
'striker-initialize-host' => "/usr/sbin/striker-initialize-host",
'striker-manage-install-target' => "/usr/sbin/striker-manage-install-target",

@ -3208,33 +3208,33 @@ WHERE
my $job_status = $results->[0]->[10];
my $modified_date = $results->[0]->[11];
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
job_host_uuid => $job_host_uuid,
job_command => $job_command,
job_data => $job_data,
job_picked_up_by => $job_picked_up_by,
job_picked_up_at => $job_picked_up_at,
job_updated => $job_updated,
job_name => $job_name,
job_progress => $job_progress,
job_title => $job_title,
job_description => $job_description,
job_status => $job_status,
modified_date => $modified_date,
job_host_uuid => $job_host_uuid,
job_command => $job_command,
job_data => $job_data,
job_picked_up_by => $job_picked_up_by,
job_picked_up_at => $job_picked_up_at,
job_updated => $job_updated,
job_name => $job_name,
job_progress => $job_progress,
job_title => $job_title,
job_description => $job_description,
job_status => $job_status,
modified_date => $modified_date,
}});
$return = {
job_host_uuid => $job_host_uuid,
job_command => $job_command,
job_data => $job_data,
job_picked_up_by => $job_picked_up_by,
job_picked_up_at => $job_picked_up_at,
job_updated => $job_updated,
job_name => $job_name,
job_progress => $job_progress,
job_title => $job_title,
job_description => $job_description,
job_status => $job_status,
modified_date => $modified_date,
job_host_uuid => $job_host_uuid,
job_command => $job_command,
job_data => $job_data,
job_picked_up_by => $job_picked_up_by,
job_picked_up_at => $job_picked_up_at,
job_updated => $job_updated,
job_name => $job_name,
job_progress => $job_progress,
job_title => $job_title,
job_description => $job_description,
job_status => $job_status,
modified_date => $modified_date,
};
return($return);
@ -3343,18 +3343,18 @@ WHERE
}
push @{$return}, {
job_uuid => $job_uuid,
job_command => $job_command,
job_data => $job_data,
job_picked_up_by => $job_picked_up_by,
job_picked_up_at => $job_picked_up_at,
job_updated => $job_updated,
job_name => $job_name,
job_progress => $job_progress,
job_title => $job_title,
job_description => $job_description,
job_status => $job_status,
modified_date => $modified_date,
job_uuid => $job_uuid,
job_command => $job_command,
job_data => $job_data,
job_picked_up_by => $job_picked_up_by,
job_picked_up_at => $job_picked_up_at,
job_updated => $job_updated,
job_name => $job_name,
job_progress => $job_progress,
job_title => $job_title,
job_description => $job_description,
job_status => $job_status,
modified_date => $modified_date,
};
}
@ -7481,6 +7481,8 @@ Variables can not be passed to this title key.
* This is not required when C<< update_progress_only >> is set
B<< Note >>: This can be set to the special C<< scancore_startup >>. When the job status is set to this value, the job will only run when ScanCore next starts up (generally after a reboot).
=head3 job_uuid (optional)
This is the C<< job_uuid >> to update. If it is not specified but the C<< job_name >> is, a check will be made to see if an entry already exists. If so, that row will be UPDATEd. If not, a random UUID will be generated and a new entry will be INSERTed.

@ -1063,7 +1063,7 @@ sub cgi
# This is a password and we're not logging sensitive data, obfuscate it.
$censored_value = $anvil->Words->string({key => "log_0186"});
}
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
"cgi::${variable}::$say_value" => $censored_value,
}});
}

@ -332,7 +332,7 @@ sub get_job_uuid
my $anvil = $self->parent;
my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0125", variables => { method => "Job->get_job_uuid()" }});
my $job_uuid = "";
my $host_uuid = defined $parameter->{host_uuid} ? $parameter->{host_uuid} : $anvil->Get->host_uuid;
my $program = defined $parameter->{program} ? $parameter->{program} : "";

@ -1205,22 +1205,22 @@ C<< Note >>: IP addresses that have been deleted will be marked so by C<< ip >>
The loaded data will be stored as:
* C<< network::<target>::interface::<iface_name>::ip >> - If an IP address is set
* C<< network::<target>::interface::<iface_name>::subnet_mask >> - If an IP is set
* C<< network::<target>::interface::<iface_name>::mac >> - Always set.
* C<< network::<target>::interface::<iface_name>::default_gateway >> = C<< 0 >> if not the default gateway, C<< 1 >> if so.
* C<< network::<target>::interface::<iface_name>::gateway >> = If the default gateway, this is the gateway IP address.
* C<< network::<target>::interface::<iface_name>::dns >> = If the default gateway, this is the comma-separated list of active DNS servers.
* C<< network::<host>::interface::<iface_name>::ip >> - If an IP address is set
* C<< network::<host>::interface::<iface_name>::subnet_mask >> - If an IP is set
* C<< network::<host>::interface::<iface_name>::mac >> - Always set.
* C<< network::<host>::interface::<iface_name>::default_gateway >> = C<< 0 >> if not the default gateway, C<< 1 >> if so.
* C<< network::<host>::interface::<iface_name>::gateway >> = If the default gateway, this is the gateway IP address.
* C<< network::<host>::interface::<iface_name>::dns >> = If the default gateway, this is the comma-separated list of active DNS servers.
Parameters;
=head3 clear (optional, default '1')
When set, any previously known information is cleared. Specifically, the C<< network::<target>> >> hash is deleted prior to the load. To prevent this, set this to C<< 0 >>.
When set, any previously known information is cleared. Specifically, the C<< network::<host>> >> hash is deleted prior to the load. To prevent this, set this to C<< 0 >>.
=head3 host (optional, default is 'host_uuid' value)
This is the optional C<< target >> string to use in the hash where the data is stored.
This is the optional C<< host >> string to use in the hash where the data is stored.
=head3 host_uuid (optional, default 'sys::host_uuid')
@ -1637,6 +1637,15 @@ sub get_ips
$anvil->data->{network}{$host}{interface}{$in_iface}{default_gateway} = 0 if not defined $anvil->data->{network}{$host}{interface}{$in_iface}{default_gateway};
$anvil->data->{network}{$host}{interface}{$in_iface}{gateway} = "" if not defined $anvil->data->{network}{$host}{interface}{$in_iface}{gateway};
$anvil->data->{network}{$host}{interface}{$in_iface}{dns} = "" if not defined $anvil->data->{network}{$host}{interface}{$in_iface}{dns};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
"network::${host}::interface::${in_iface}::ip" => $anvil->data->{network}{$host}{interface}{$in_iface}{ip},
"network::${host}::interface::${in_iface}::subnet_mask" => $anvil->data->{network}{$host}{interface}{$in_iface}{subnet_mask},
"network::${host}::interface::${in_iface}::mac_address" => $anvil->data->{network}{$host}{interface}{$in_iface}{mac_address},
"network::${host}::interface::${in_iface}::mtu" => $anvil->data->{network}{$host}{interface}{$in_iface}{mtu},
"network::${host}::interface::${in_iface}::default_gateway" => $anvil->data->{network}{$host}{interface}{$in_iface}{default_gateway},
"network::${host}::interface::${in_iface}::gateway" => $anvil->data->{network}{$host}{interface}{$in_iface}{gateway},
"network::${host}::interface::${in_iface}::dns" => $anvil->data->{network}{$host}{interface}{$in_iface}{dns},
}});
}
next if not $in_iface;
if ($in_iface eq "lo")

@ -162,7 +162,7 @@ sub add_target_to_known_hosts
{
# We don't know about this machine yet, so scan it.
my $added = $anvil->Remote->_call_ssh_keyscan({
debug => $debug,
debug => 2,
target => $target,
port => $port,
user => $user,
@ -171,10 +171,17 @@ sub add_target_to_known_hosts
if (not $added)
{
# Failed to add. :(
my $say_user = $user;
if (($say_user =~ /^\d+$/) && (getpwuid($user)))
{
$say_user = getpwuid($user);
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { say_user => $say_user }});
}
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "error_0009", variables => {
target => $target,
port => $port,
user => $user,
user => $say_user,
}});
return(1);
}
@ -378,7 +385,7 @@ sub call
# In case the user is using ports in /etc/ssh/ssh_config, we'll want to check for an entry.
$anvil->System->read_ssh_config({deubg => $debug});
$anvil->data->{hosts}{$target}{port} = "" if not defined $anvil->data->{hosts}{$target}{port};
$anvil->data->{hosts}{$target}{port} = 22 if not defined $anvil->data->{hosts}{$target}{port};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { "hosts::${target}::port" => $anvil->data->{hosts}{$target}{port} }});
if ($anvil->data->{hosts}{$target}{port} =~ /^\d+$/)
{
@ -686,9 +693,9 @@ sub call
### but it's here just in case.
# If the output of the shell call doesn't end in a newline, the return_code:X
# could be appended. This catches those cases and removes it.
$return_code = $1;
$line =~ s/return_code:\d+$//;
$output .= $line."\n";
$return_code = $1;
$line =~ s/return_code:\d+$//;
$clean_output .= $line."\n";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
line => $line,
output => $output,
@ -702,6 +709,7 @@ sub call
}
$clean_output =~ s/\n$//;
$output = $clean_output;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { output => $output }});
# Have we been asked to close the connection?
if ($close)
@ -1019,10 +1027,16 @@ sub _call_ssh_keyscan
}});
# Log what we're doing
my $say_user = $user;
if (($say_user =~ /^\d+$/) && (getpwuid($user)))
{
$say_user = getpwuid($user);
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { say_user => $say_user }});
}
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, priority => "alert", key => "log_0159", variables => {
target => $target,
port => $port,
user => $user,
user => $say_user,
}});
# Redirect STDERR to STDOUT and grep off the comments.

@ -136,8 +136,8 @@ sub generate_manifest
if (($network eq "bcn") && ($i eq "1"))
{
# Get the IP.
my $ipmi_ip_key = $machine."_ipmi_ip";
$machines->{$machine}{ipmi_ip} = defined $anvil->data->{cgi}{$ipmi_ip_key}{value} ? $anvil->data->{cgi}{$ipmi_ip_key}{value} : "";
my $ipmi_ip_key = $machine."_ipmi_ip";
$machines->{$machine}{ipmi_ip} = defined $anvil->data->{cgi}{$ipmi_ip_key}{value} ? $anvil->data->{cgi}{$ipmi_ip_key}{value} : "";
# Find the UPSes.
foreach my $ups_name (sort {$a cmp $b} keys %{$anvil->data->{upses}{ups_name}})

@ -7839,21 +7839,21 @@ sub sanity_check_step2
}});
foreach my $count (1..$network_count)
{
my $this_network = $network.$count;
my $this_ip_key = $this_network."_ip";
my $this_network = $network.$count;
my $this_ip_key = $this_network."_ip";
my $this_subnet_mask_key = $this_network."_subnet_mask";
my $this_iface1_key = $this_network."_link1_mac_to_set";
my $this_iface2_key = $this_network."_link2_mac_to_set";
my $this_iface1_key = $this_network."_link1_mac_to_set";
my $this_iface2_key = $this_network."_link2_mac_to_set";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
count => $count,
this_ip_key => $this_ip_key,
count => $count,
this_ip_key => $this_ip_key,
this_subnet_mask_key => $this_subnet_mask_key,
this_iface1_key => $this_iface1_key,
this_iface2_key => $this_iface2_key,
"cgi::${this_ip_key}::value" => $anvil->data->{cgi}{$this_ip_key}{value},
this_iface1_key => $this_iface1_key,
this_iface2_key => $this_iface2_key,
"cgi::${this_ip_key}::value" => $anvil->data->{cgi}{$this_ip_key}{value},
"cgi::${this_subnet_mask_key}::value" => $anvil->data->{cgi}{$this_subnet_mask_key}{value},
"cgi::${this_iface1_key}::value" => $anvil->data->{cgi}{$this_iface1_key}{value},
"cgi::${this_iface2_key}::value" => $anvil->data->{cgi}{$this_iface2_key}{value},
"cgi::${this_iface1_key}::value" => $anvil->data->{cgi}{$this_iface1_key}{value},
"cgi::${this_iface2_key}::value" => $anvil->data->{cgi}{$this_iface2_key}{value},
}});
# This will be used to tell the user which interface has a problem, if one exists.

@ -331,6 +331,10 @@ drbdsetup show all --show-defaults
drbdsetup net-options srv01-c7_0 2 --_name=m3-a02n01.alteeve.com --csums-alg=md5 --data-integrity-alg=md5 --after-sb-0pri=discard-zero-changes --after-sb-1pri=discard-secondary --after-sb-2pri=disconnect --protocol=C --fencing=resource-and-stonith --allow-two-primaries=yes
drbdsetup net-options srv01-c7_0 2 --_name=m3-a02n01.alteeve.com --csums-alg=md5 --data-integrity-alg=md5 --after-sb-0pri=discard-zero-changes --after-sb-1pri=discard-secondary --after-sb-2pri=disconnect --protocol=C --fencing=resource-and-stonith --allow-two-primaries=yes
# Adding a second volume to a running resource;
- I wonder if you'd have the same results if you could get vol1 into an UpToDate/UpToDate state using the drbdsetup equivalent of drbdadm new-current-uuid --clear-bitmap <res>
# Migrate:
virsh -c qemu+ssh://root@m3-a02n02.alteeve.com/system list

@ -332,6 +332,15 @@ Output (if any):
- shell_call: [#!variable!shell_call!#]
]]></key>
<key name="error_0240">Usage: [#!variable!program!# --config /path/to/config].</key>
<key name="error_0241">The file: [#!variable!file!#] doesn't appear to be valid.</key>
<key name="error_0242">Failed to find a matching entry in the file: [#!variable!file!#]. Please make sure the MAC addresses in the config are accurate for these systems.</key>
<key name="error_0243">Missing variable: [#!variable!variable!#] from config file: [#!data!switches::config!#].</key>
<key name="error_0244">The length of the prefix: [#!variable!prefix!#] is: [#!variable!length!#]. The prefix needs to be not more than 5.</key>
<key name="error_0245">The DNS IP: [#!variable!ip!#] is invalid.</key>
<key name="error_0246">The gateway IP: [#!variable!ip!#] is invalid.</key>
<key name="error_0247">The variable: [#!variable!variable!#] is invalid: [#!variable!value!#].</key>
<key name="error_0248">Failed to add the UPS: [#!variable!ups_name!#] at: [#!variable!aups_ip_address!#] using the agent: [#!variable!ups_agent!#]!</key>
<key name="error_0249">Failed to add the fence device: [#!variable!fence_name!#] using the agent: [#!variable!fence_agent!#]!</key>
<!-- Files templates -->
<!-- NOTE: Translating these files requires an understanding of which likes are translatable -->
@ -674,6 +683,45 @@ It should be provisioned in the next minute or two.</key>
<key name="job_0222">Preparing to delete the server: [#!variable!server_name!#].</key>
<key name="job_0223">Using virsh to destroy (force off) the server: [#!variable!server_name!#], if it is still running.</key>
<key name="job_0224">Enabled the HA repository for CentOS Stream.</key>
<key name="job_0225">Initialize Stage-1 installed systems into a full Anvil!.</key>
<key name="job_0226">This program is designed the automation of turning a set of stage-1 (bare OS + anvil-repo) systems and turn them into a fully functioning Anvil! system.</key>
<key name="job_0227">We need to setup pairing with Striker: [#!variable!number!#]. We will wait for it to come up. Be sure that you're run 'striker-auto-initialize-all' on it.</key>
<key name="job_0228">Successfully connected to Striker: [#!variable!number!#] using the IP: [#!variable!ip!#]!</key>
<key name="job_0229">No connection to Striker: [#!variable!number!#] via the IP: [#!variable!ip!#].</key>
<key name="job_0230">Failed to connect Striker: [#!variable!number!#] over any IPs. Sleeping a bit and then trying again.</key>
<key name="job_0231">Waiting now for the peer Striker: [#!variable!number!#] with host UUID: [#!variable!peer_host_uuid!#] to show up in our database.</key>
<key name="job_0232">The peer Striker: [#!variable!number!#] with host name: [#!variable!peer_host_name!#] has successfully peered with us!</key>
<key name="job_0233">The peer Striker: [#!variable!number!#] with host UUID: [#!variable!peer_host_uuid!#] has not yet started using our database. Waiting a bit before checking again...</key>
<key name="job_0234">Peering Striker dashbaords</key>
<key name="job_0235">Striker peers now working with us!</key>
<key name="job_0236">Adding UPSes now.</key>
<key name="job_0237">Successfully added/updated the UPS: [#!variable!ups_name!#] at: [#!variable!ups_ip_address!#] using the agent: [#!variable!ups_agent!#]. It's UPS UUID is: [#!variable!ups_uuid!#].</key>
<key name="job_0238">Failed to assemble the Anvil!, aborting.</key>
<key name="job_0239">All UPSes added/updated.</key>
<key name="job_0240">Adding fence devices now.</key>
<key name="job_0241">Successfully added/updated the fence device: [#!variable!fence_name!#] using the agent: [#!variable!fence_agent!#]. It's fence UUID is: [#!variable!fence_uuid!#].</key>
<key name="job_0242">All fence devices added/updated.</key>
<key name="job_0243">Creating Install Manifest(s).</key>
<key name="job_0244">Created the manifest: [#!variable!manifest_name!#] with the UUID: [#!variable!manifest_uuid!#].</key>
<key name="job_0245">Install Manifest(s) created.</key>
<key name="job_0246">Initializing nodes and, if applicable, DR host(s).</key>
<key name="job_0247">The machine: [#!variable!machine!#] is already initialized and has the host UUID: [#!variable!host_uuid!#]. No need to initialize.</key>
<key name="job_0248">Trying to connect to: [#!variable!machine!#] using IP: [#!variable!ip!#] with the initial password.</key>
<key name="job_0249">Trying to connect to: [#!variable!machine!#] using IP: [#!variable!ip!#] with the desired password.</key>
<key name="job_0250">Connected! We will initialize using the IP: [#!variable!ip!#]</key>
<key name="job_0251">Failed to connect to: [#!variable!machine!#] using any IP address. We'll sleep and then try again shortly.</key>
<key name="job_0252">Created the job to initialize: [#!variable!host_name!#] via the IP address: [#!variable!ip!#] with job UUID: [#!variable!job_uuid!#].</key>
<key name="job_0253">All machines should now be initializing. Waiting now for all machines to register in the database.</key>
<key name="job_0254">The machine: [#!variable!machine!#] hasn't connected to the database yet.</key>
<key name="job_0255">One (or more) machines have not yet initialized. Waiting a few seconds, then checking again.</key>
<key name="job_0256">All machines have been initialized!</key>
<key name="job_0257">Ready to create jobs to assemble Anvil! systems.</key>
<key name="job_0258">Created (or updated) the Anvil! [#!variable!anvil_name!#] with the UUID: [#!variable!anvil_uuid!#].</key>
<key name="job_0259">Created the job for: [#!variable!machine_name!#] with host UUID: [#!variable!host_uuid!#] to the Anvil!: [#!variable!anvil_name!#] with the job UUID: [#!variable!job_uuid!#].</key>
<key name="job_0260">Add machines have been asked to joing their Anvil! system(s). We'll now wait for all jobs to complete.</key>
<key name="job_0261">The job UUID: [#!variable!job_uuid!#] is at: [#!variable!progress!#%].</key>
<key name="job_0262">Not all jobs are done yet, will check again in a bit.</key>
<key name="job_0263">All jobs are complete! Baring problems, the Anvil! system(s) should now be ready to use.</key>
<!-- Log entries -->
<key name="log_0001">Starting: [#!variable!program!#].</key>
@ -1360,6 +1408,7 @@ The file: [#!variable!file!#] needs to be updated. The difference is:
<key name="log_0590">Wiping the metadata from the DRBD resource: [#!variable!resource!#].</key>
<key name="log_0591">Wiping any file system signatures and then deleting the logical volume: [#!variable!device_path!#].</key>
<key name="log_0592">The resource name: [#!variable!resource_name!#] was found, returning the first TCP port and minor number.</key>
<key name="log_0593">The job: [#!variable!command!#] with UUID: [#!variable!job_uuid!#] is a start-time job, not running it now.</key>
<!-- Messages for users (less technical than log entries), though sometimes used for logs, too. -->
<key name="message_0001">The host name: [#!variable!target!#] does not resolve to an IP address.</key>
@ -1676,6 +1725,7 @@ Are you sure that you want to delete the server: [#!variable!server_name!#]? [Ty
<key name="message_0218">Preparing to migrate a server (or all servers).</key>
<key name="message_0219">- #!variable!server_name!# (Current state: [#!variable!server_state!#])</key>
<key name="message_0220">- * #!variable!server_name!# (Deleted, name can be reused)</key>
<key name="message_0221">We're Striker: [#!variable!striker!#], and we're now configured, so we're done. Striker 1 will finish configuration.</key>
<!-- Success messages shown to the user -->
<key name="ok_0001">Saved the mail server information successfully!</key>

@ -717,9 +717,9 @@ FROM
WHERE
variable_source_table = 'hosts'
AND
variable_source_uuid = ".$anvil->Database->quote($anvil->Get->host_uuid)."
variable_source_uuid = ".$anvil->Database->quote($anvil->Get->host_uuid)."
AND
variable_name = 'reboot::needed'
variable_name = 'reboot::needed'
;";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, key => "log_0124", variables => { query => $query }});
my $results = $anvil->Database->query({query => $query, source => $THIS_FILE, line => __LINE__});
@ -774,6 +774,9 @@ AND
}
}
# Now look for jobs that have a job status of 'scancore_startup'
run_jobs($anvil, 1);
# Check the firewall needs to be updated.
check_firewall($anvil);
@ -856,7 +859,7 @@ sub keep_running
}
# Run any pending jobs by calling 'anvil-jobs' with the 'job_uuid' as a background process.
run_jobs($anvil) if not $anvil->data->{sys}{mapping_network};
run_jobs($anvil, 0) if not $anvil->data->{sys}{mapping_network};
return(0);
}
@ -866,7 +869,8 @@ sub keep_running
# invoked to handle it.
sub run_jobs
{
my ($anvil) = @_;
my ($anvil, $startup) = @_;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { startup => $startup }});
# This will be set to 1 if any jobs are not complete, preventing a restart of the daemon if it's
# changed on disk.
@ -876,11 +880,13 @@ sub run_jobs
my $jobs_file = "{\"jobs\":[\n";
# Get a list of pending or incomplete jobs.
my $return = $anvil->Database->get_jobs({debug => 3, ended_within => 300});
my $count = @{$return};
my $ended_within = $startup ? 1 : 300;
my $return = $anvil->Database->get_jobs({debug => 3, ended_within => $ended_within});
my $count = @{$return};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
'return' => $return,
count => $count,
ended_within => $ended_within,
'return' => $return,
count => $count,
}});
foreach my $hash_ref (@{$return})
{
@ -1023,6 +1029,17 @@ sub run_jobs
# If the job is done, move on.
next if $job_progress eq "100";
# If 'startup' is set, we only care if 'job_status' is 'scancore_startup'
if ((not $startup) && ($say_status eq "scancore_startup"))
{
# Skip this, it will run next time anvil-daemon restarts.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0593", variables => {
command => $job_command,
job_uuid => $job_uuid,
}});
next;
}
# If the job is not running, start it.
if ((not $job_picked_up_by) && ($job_progress ne "100") && (not $anvil->data->{switches}{'no-start'}))
{

File diff suppressed because it is too large Load Diff

@ -1,20 +1,160 @@
# This is an example script to feed to 'striker-auto-initialize-all'.
#
base::password::current = Initial1
base::password::desired = super secret password
#############################################################################################################
# Common values #
#############################################################################################################
# This is the listed owner, department or organization who this Anvil! serves.
base::organization_name = Alteeve's Niche!
# The prefix for the Anvil! system. The can be up to five characters long.
base::prefix = an
# This is the domain to use for the Anvil! and member machine host names.
base::domain = alteeve.com
# These are the DNS server to use when configuring networks, comma separated.
base::dns = 8.8.8.8,8.8.4.4
# If you have specific NTP servers to use, specify them here
base::ntp =
# If you want to set a specific MTU, set it here.
base::mtu =
# When generating the Anvil! install manifest, what will the Anvil! sequence be?
base::anvil::sequence = 1
# This is the default gateway for the IFN
base::gateway = 192.168.122.1
base::interface = ifn1
# Startup IP is used for peers to find us
striker::1::network::startup_ip = 192.168.122.145
striker::1::network::ifn::1::ip = 192.168.122.11
# This is the IFN network on which the gateway will be configured.
base::gateway_network = ifn1
# This is the startup password for newly built nodes and DR hosts we'll be integrating.
base::password::current = Initial1
# This is the password to set for all systems.
base::password::desired = super secret password
# If registering with RH, here is where you can set your credentials.
base::rhn::user =
base::rhn::password =
#############################################################################################################
# Striker configurations #
#############################################################################################################
### NOTE: 'striker::1::' is the Striker that will merge the dashboards, initialize nodes / DR, create the
### install manifest (and fence devices / upses), and assemble the nodes. As such, 'striker::1::' is
### required!
striker::1::network::ifn::1::ip = 192.168.122.251
striker::1::network::ifn::1::subnet_mask = 255.255.255.0
striker::1::network::ifn::1::link::1::mac = aa:bb:cc:dd:ee:ff
striker::1::network::bcn::1::ip = 192.168.122.11
striker::1::network::bcn::1::subnet_mask = 255.255.255.0
striker::1::network::bcn::1::link::1::mac = aa:bb:cc:dd:ff:00
striker::1::network::ifn::1::link::1::mac = 52:54:00:df:03:e
striker::1::network::ifn::1::link::2::mac = 52:54:00:45:6e:5d
striker::1::network::bcn::1::ip = 10.201.4.1
striker::1::network::bcn::1::subnet_mask = 255.255.0.0
striker::1::network::bcn::1::link::1::mac = 52:54:00:d9:24:52
striker::1::network::bcn::1::link::2::mac = 52:54:00:aa:4d:e0
striker::2::network::ifn::1::ip = 192.168.122.252
striker::2::network::ifn::1::subnet_mask = 255.255.255.0
striker::2::network::ifn::1::link::1::mac = 52:54:00:41:1f:7d
striker::2::network::ifn::1::link::2::mac = 52:54:00:33:f7:de
striker::2::network::bcn::1::ip = 10.201.4.2
striker::2::network::bcn::1::subnet_mask = 255.255.0.0
striker::2::network::bcn::1::link::1::mac = 52:54:00:b8:34:a7
striker::2::network::bcn::1::link::2::mac = 52:54:00:30:f9:db
#############################################################################################################
# Node and DR configuration #
#############################################################################################################
### UPSes - Optional
# Note: The 'ups_agent' is the ScanCore agent that will be used to monitor to state/health of the UPSes.
ups::1::name = an-ups01
ups::1::agent = scan-apc-ups
ups::1::ip_address = 10.201.3.1
ups::2::name = an-ups01
ups::2::agent = scan-apc-ups
ups::2::ip_address = 10.201.3.1
### Fence device(s)
# NOTE: Do NOT specify fence_ipmilan! It is detected / configured automatically.
# The fence_arguments only needs to contain variable="value" pairs that don't have a useful default.
fence::1::name = gravitar
fence::1::agent = virsh
fence::1::arguments = action="reboot" ip="192.168.122.1" password_script="/root/gravitar_password" username="root"
# Example PDUs
#fence::2::name = an-pdu01
#fence::2::agent = apc_snmp
#fence::2::arguments = action="reboot" ip="10.201.2.1"
#fence::3::name = an-pdu02
#fence::3::agent = apc_snmp
#fence::3::arguments = action="reboot" ip="10.201.2.2"
# Anvil description
anvil::1::description = "Test Anvil! running on gravitar"
### Nodes
anvil::1::node::1::start_ip = 192.168.122.235
anvil::1::node::1::network::ifn::1::ip = 192.168.122.11
anvil::1::node::1::network::ifn::1::subnet_mask = 255.255.255.0
anvil::1::node::1::network::ifn::1::link::1::mac = 52:54:00:17:d6:0b
anvil::1::node::1::network::ifn::1::link::2::mac = 52:54:00:c4:87:b6
anvil::1::node::1::network::bcn::1::ip = 10.201.10.1
anvil::1::node::1::network::bcn::1::ipmi_ip = 10.201.11.1
anvil::1::node::1::network::bcn::1::subnet_mask = 255.255.0.0
anvil::1::node::1::network::bcn::1::link::1::mac = 52:54:00:d2:6b:0b
anvil::1::node::1::network::bcn::1::link::2::mac = 52:54:00:01:11:0e
anvil::1::node::1::network::sn::1::ip = 10.101.4.1
anvil::1::node::1::network::sn::1::subnet_mask = 255.255.0.0
anvil::1::node::1::network::sn::1::link::1::mac = 52:54:00:7e:b8:9e
anvil::1::node::1::network::sn::1::link::2::mac = 52:54:00:23:e8:46
# Fence (IPMI configured automatically), same fence types grouped automatically
anvil::1::node::1::fence::1::name = gravitar
anvil::1::node::1::fence::1::port = an-a01n01
#anvil::1::node::1::fence::2::name = an-pdu01
#anvil::1::node::1::fence::2::port = 1
#anvil::1::node::1::fence::3::name = an-pdu02
#anvil::1::node::1::fence::3::port = 1
# Set for UPSes powering the node, if any
#anvil::1::node::1::ups::1::name = an-ups01
#anvil::1::node::1::ups::2::name = an-ups02
anvil::1::node::2::start_ip = 192.168.122.185
anvil::1::node::2::network::ifn::1::ip = 192.168.122.12
anvil::1::node::2::network::ifn::1::subnet_mask = 255.255.255.0
anvil::1::node::2::network::ifn::1::link::1::mac = 52:54:00:09:b7:90
anvil::1::node::2::network::ifn::1::link::2::mac = 52:54:00:78:a3:41
anvil::1::node::2::network::bcn::1::ip = 10.201.10.2
anvil::1::node::2::network::bcn::1::ipmi_ip = 10.201.11.2
anvil::1::node::2::network::bcn::1::subnet_mask = 255.255.0.0
anvil::1::node::2::network::bcn::1::link::1::mac = 52:54:00:06:2e:2d
anvil::1::node::2::network::bcn::1::link::2::mac = 52:54:00:14:16:98
anvil::1::node::2::network::sn::1::ip = 10.101.4.2
anvil::1::node::2::network::sn::1::subnet_mask = 255.255.0.0
anvil::1::node::2::network::sn::1::link::1::mac = 52:54:00:79:1c:ce
anvil::1::node::2::network::sn::1::link::2::mac = 52:54:00:5d:d3:6d
# Set for UPSes powering the node, if any
anvil::1::node::2::ups::1::name = an-ups01
anvil::1::node::2::ups::2::name = an-ups02
### DR host (optional)
anvil::1::dr::1::start_ip = 192.168.122.153
anvil::1::dr::1::network::ifn::1::ip = 192.168.122.10
anvil::1::dr::1::network::ifn::1::subnet_mask = 255.255.255.0
anvil::1::dr::1::network::ifn::1::link::1::mac = 52:54:00:6d:05:5e
anvil::1::dr::1::network::ifn::1::link::2::mac = 52:54:00:7e:87:ec
anvil::1::dr::1::network::bcn::1::ip = 10.201.10.3
anvil::1::dr::1::network::bcn::1::ipmi_ip = 10.201.11.3
anvil::1::dr::1::network::bcn::1::subnet_mask = 255.255.0.0
anvil::1::dr::1::network::bcn::1::link::1::mac = 52:54:00:6a:88:c2
anvil::1::dr::1::network::bcn::1::link::2::mac = 52:54:00:4b:58:fe
anvil::1::dr::1::network::sn::1::ip = 10.101.4.3
anvil::1::dr::1::network::sn::1::subnet_mask = 255.255.0.0
anvil::1::dr::1::network::sn::1::link::1::mac = 52:54:00:d6:f8:8d
anvil::1::dr::1::network::sn::1::link::2::mac = 52:54:00:51:7b:b6

Loading…
Cancel
Save