Skip to content

Commit 7e77c21

Browse files
committed
(PE-39352,PE-39351) Gather PE version in get_peadm_config task
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.
1 parent 532aebb commit 7e77c21

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tasks/get_peadm_config.rb

+7
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def config
4141

4242
# Build and return the task output
4343
{
44+
'pe_version' => pe_version,
4445
'params' => {
4546
'primary_host' => primary,
4647
'replica_host' => replica,
@@ -73,6 +74,12 @@ def config
7374
}
7475
end
7576

77+
# @return [String] Local PE version string.
78+
def pe_version
79+
pe_build_file = '/opt/puppetlabs/server/pe_build'
80+
File.read(pe_build_file).strip if File.exist?(pe_build_file)
81+
end
82+
7683
# Returns a GetPEAdmConfig::NodeGroups object created from the /groups object
7784
# returned by the classifier
7885
def groups

0 commit comments

Comments
 (0)