Merge pull request #249 from ClusterLabs/anvil-tools-dev

* Added variables to record when pacemaker and DRBD are configured.
This commit is contained in:
digimer-bot 2022-10-18 12:59:43 -04:00 committed by GitHub
commit f6b23de2eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 1 deletions

View File

@ -568,7 +568,8 @@ resource #!variable!server!# {
c-max-rate 500M; c-max-rate 500M;
} }
net { net {
protocol C; protocol C;
verify-alg md5;
fencing resource-and-stonith; fencing resource-and-stonith;
} }
} }
@ -801,6 +802,7 @@ sys::manage::firewall = 1
} }
net { net {
protocol #!variable!protocol!#; protocol #!variable!protocol!#;
verify-alg md5;
fencing #!variable!fencing!#; fencing #!variable!fencing!#;
} }
} }
@ -829,6 +831,7 @@ resource #!variable!server!# {
} }
net { net {
protocol #!variable!protocol!#; protocol #!variable!protocol!#;
verify-alg md5;
fencing #!variable!fencing!#; fencing #!variable!fencing!#;
} }
} }
@ -2998,6 +3001,9 @@ If you are comfortable that the target has changed for a known reason, you can s
<key name="striker_0292">Stay Off</key> <key name="striker_0292">Stay Off</key>
<key name="striker_0293">This is the command used to provision the referenced server.</key> <key name="striker_0293">This is the command used to provision the referenced server.</key>
<key name="striker_0294">This indicates if a Striker's DB is available to be used.</key> <key name="striker_0294">This indicates if a Striker's DB is available to be used.</key>
<key name="striker_0295">This indicates that this node has had pacemaker configured.</key>
<key name="striker_0296">This indicates that this node or DR host has had base DRBD configured.</key>
<key name="striker_0297">This indicates that this node or DR host has completed all tasks needed to be a full member of the Anvil!.</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>

View File

@ -68,6 +68,18 @@ configure_drbd($anvil);
update_progress($anvil, 100, "job_0128"); update_progress($anvil, 100, "job_0128");
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "job_0128"}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "job_0128"});
# Record that we're done configuring pacemaker.
$anvil->Database->insert_or_update_variables({
variable_name => "system::all::configured",
variable_value => 1,
variable_default => "",
variable_description => "striker_0297",
variable_section => "system",
variable_source_uuid => $anvil->data->{sys}{host_uuid},
variable_source_table => "hosts",
});
$anvil->nice_exit({exit_code => 0}); $anvil->nice_exit({exit_code => 0});
############################################################################################################# #############################################################################################################
@ -97,6 +109,17 @@ sub configure_drbd
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "job_0128"}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "job_0128"});
} }
# Record that we're done configuring pacemaker.
$anvil->Database->insert_or_update_variables({
variable_name => "system::drbd::configured",
variable_value => 1,
variable_default => "",
variable_description => "striker_0296",
variable_section => "system",
variable_source_uuid => $anvil->data->{sys}{host_uuid},
variable_source_table => "hosts",
});
return(0); return(0);
} }
@ -1117,6 +1140,17 @@ sub configure_pacemaker
check_corosync($anvil); check_corosync($anvil);
} }
# Record that we're done configuring pacemaker.
$anvil->Database->insert_or_update_variables({
variable_name => "system::pacemaker::configured",
variable_value => 1,
variable_default => "",
variable_description => "striker_0295",
variable_section => "system",
variable_source_uuid => $anvil->data->{sys}{host_uuid},
variable_source_table => "hosts",
});
return(0); return(0);
} }

View File

@ -375,6 +375,8 @@ sub add_repos
$anvil->data->{job}{progress} += 5; $anvil->data->{job}{progress} += 5;
update_progress($anvil, $anvil->data->{job}{progress}, "job_0028"); update_progress($anvil, $anvil->data->{job}{progress}, "job_0028");
### TODO: Rework this, add $anvil->data->{data}{enterprise_uuid}
# Add the local repo. # Add the local repo.
my $repo = $anvil->Striker->get_local_repo({debug => 2}); my $repo = $anvil->Striker->get_local_repo({debug => 2});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { repo => $repo }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { repo => $repo }});
@ -1015,6 +1017,15 @@ sub get_job_details
$anvil->nice_exit({exit_code => 3}); $anvil->nice_exit({exit_code => 3});
} }
# Set up all possible variables.
$anvil->data->{data}{enterprise_uuid} = "";
$anvil->data->{data}{host_ip_address} = "";
$anvil->data->{data}{password} = "";
$anvil->data->{data}{rh_password} = "";
$anvil->data->{data}{rh_user} = "";
$anvil->data->{data}{ssh_port} = "";
$anvil->data->{data}{type} = "";
$anvil->data->{jobs}{job_uuid} = $anvil->data->{switches}{'job-uuid'}; $anvil->data->{jobs}{job_uuid} = $anvil->data->{switches}{'job-uuid'};
$anvil->data->{jobs}{job_command} = $return->{job_command}; $anvil->data->{jobs}{job_command} = $return->{job_command};
$anvil->data->{jobs}{job_data} = $return->{job_data}; $anvil->data->{jobs}{job_data} = $return->{job_data};