fix: replace puppetdbquery with native PQL queries (#457)
Replace deprecated dalen-puppetdbquery module with native puppetdb_query function using PQL syntax to resolve URI.escape compatibility issues. This is required to migrated to Puppet 8 (and kubernetes). Changes: - Remove dalen-puppetdbquery dependency from Puppetfile - Replace query_nodes() calls with puppetdb_query() using PQL syntax - Update 27 function calls across 18 Puppet manifests - Maintain equivalent functionality with improved compatibility Reviewed-on: #457
This commit was merged in pull request #457.
This commit is contained in:
@@ -24,10 +24,13 @@ class profiles::proxmox::clusterinit {
|
||||
}
|
||||
}
|
||||
|
||||
$servers_array = sort(query_nodes(
|
||||
"enc_role='${membersrole}' and country='${facts['country']}' and region='${facts['region']}'",
|
||||
'networking.fqdn'
|
||||
))
|
||||
$servers_array = sort(puppetdb_query(
|
||||
"facts[certname] {
|
||||
name = 'enc_role' and value = '${membersrole}' and
|
||||
certname in facts[certname] { name = 'country' and value = '${facts['country']}' } and
|
||||
certname in facts[certname] { name = 'region' and value = '${facts['region']}' }
|
||||
}"
|
||||
).map |$fact| { $fact['certname'] })
|
||||
|
||||
if ! $profiles::proxmox::params::pve_clusterinit_master {
|
||||
if !empty($servers_array) {
|
||||
|
||||
@@ -11,13 +11,14 @@ class profiles::proxmox::clusterjoin {
|
||||
$root_password = $profiles::proxmox::params::root_password
|
||||
|
||||
# query puppetdb for list of cluster members
|
||||
$members_array = sort(query_nodes(
|
||||
"enc_role='${membersrole}' and \
|
||||
country='${facts['country']}' and \
|
||||
region='${facts['region']}' and \
|
||||
pve_cluster.cluster_name='${clustername}'",
|
||||
'networking.fqdn'
|
||||
))
|
||||
$members_array = sort(puppetdb_query(
|
||||
"facts[certname] {
|
||||
name = 'enc_role' and value = '${membersrole}' and
|
||||
certname in facts[certname] { name = 'country' and value = '${facts['country']}' } and
|
||||
certname in facts[certname] { name = 'region' and value = '${facts['region']}' } and
|
||||
certname in facts[certname] { name = 'pve_cluster' and value.cluster_name = '${clustername}' }
|
||||
}"
|
||||
).map |$fact| { $fact['certname'] })
|
||||
|
||||
# check if the pve kernerl is running
|
||||
if $facts['kernelrelease'] == $profiles::proxmox::params::pve_kernel_release {
|
||||
|
||||
Reference in New Issue
Block a user