Skip to content

Commit

Permalink
(PE-39352,PE-39351) Gather PE version in get_peadm_config task
Browse files Browse the repository at this point in the history
Adds a lookup of the pe_build file to provide the PE version in the hash
returned by the get_peadm_config task.

We will use this in add_database and backup/restore plans as a version
gate for handling the newer host_action_collector database that is only
present in PE 2023.7+, for example.
  • Loading branch information
jpartlow committed Dec 4, 2024
1 parent 532aebb commit 7e77c21
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tasks/get_peadm_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def config

# Build and return the task output
{
'pe_version' => pe_version,
'params' => {
'primary_host' => primary,
'replica_host' => replica,
Expand Down Expand Up @@ -73,6 +74,12 @@ def config
}
end

# @return [String] Local PE version string.
def pe_version
pe_build_file = '/opt/puppetlabs/server/pe_build'
File.read(pe_build_file).strip if File.exist?(pe_build_file)
end

# Returns a GetPEAdmConfig::NodeGroups object created from the /groups object
# returned by the classifier
def groups
Expand Down

0 comments on commit 7e77c21

Please sign in to comment.