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:
@@ -18,9 +18,15 @@ class profiles::dns::base (
|
||||
$nameserver_array = $ns_role ? {
|
||||
undef => $nameservers,
|
||||
default => $use_ns ? {
|
||||
'all' => query_nodes("enc_role='${ns_role}'", 'networking.ip'),
|
||||
'region' => query_nodes("enc_role='${ns_role}' and region=${facts['region']}", 'networking.ip'),
|
||||
'country' => query_nodes("enc_role='${ns_role}' and country=${facts['country']}", 'networking.ip'),
|
||||
'all' => puppetdb_query(
|
||||
"inventory[networking.ip] { facts.enc_role = '${ns_role}' }"
|
||||
).map |$node| { $node['networking.ip'] },
|
||||
'region' => puppetdb_query(
|
||||
"inventory[networking.ip] { facts.enc_role = '${ns_role}' and facts.region = '${facts['region']}' }"
|
||||
).map |$node| { $node['networking.ip'] },
|
||||
'country' => puppetdb_query(
|
||||
"inventory[networking.ip] { facts.enc_role = '${ns_role}' and facts.country = '${facts['country']}' }"
|
||||
).map |$node| { $node['networking.ip'] },
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user