fix: replace puppetdbquery with native PQL queries

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
This commit is contained in:
2026-03-21 21:54:24 +11:00
parent 1d41d07b2d
commit e58e699ee3
18 changed files with 102 additions and 44 deletions
+9 -3
View File
@@ -26,9 +26,15 @@ class profiles::ntp::client (
$ntpserver_array = $ntp_role ? {
undef => $peers,
default => $use_ntp ? {
'all' => query_nodes("enc_role='${ntp_role}'", 'networking.fqdn'),
'region' => query_nodes("enc_role='${ntp_role}' and region=${facts['region']}", 'networking.fqdn'),
'country' => query_nodes("enc_role='${ntp_role}' and country=${facts['country']}", 'networking.fqdn'),
'all' => puppetdb_query(
"inventory[networking.fqdn] { facts.enc_role = '${ntp_role}' }"
).map |$node| { $node['networking.fqdn'] },
'region' => puppetdb_query(
"inventory[networking.fqdn] { facts.enc_role = '${ntp_role}' and facts.region = '${facts['region']}' }"
).map |$node| { $node['networking.fqdn'] },
'country' => puppetdb_query(
"inventory[networking.fqdn] { facts.enc_role = '${ntp_role}' and facts.country = '${facts['country']}' }"
).map |$node| { $node['networking.fqdn'] },
}
}