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:
@@ -167,7 +167,13 @@ class stalwart (
|
||||
|
||||
# Query cluster members for validation
|
||||
$cluster_query = "enc_role='${cluster_role}' and country='${facts['country']}' and region='${facts['region']}'"
|
||||
$cluster_members_raw = query_nodes($cluster_query, 'networking.fqdn')
|
||||
$cluster_members_raw = puppetdb_query(
|
||||
"inventory[networking.fqdn] {
|
||||
facts.enc_role = '${cluster_role}' and
|
||||
facts.country = '${facts['country']}' and
|
||||
facts.region = '${facts['region']}'
|
||||
}"
|
||||
).map |$node| { $node['networking.fqdn'] }
|
||||
$cluster_members = $cluster_members_raw ? {
|
||||
undef => [],
|
||||
default => $cluster_members_raw,
|
||||
@@ -180,7 +186,13 @@ class stalwart (
|
||||
|
||||
# Query HAProxy nodes for proxy trusted networks
|
||||
$haproxy_query = "enc_role='${haproxy_role}' and country='${facts['country']}' and region='${facts['region']}'"
|
||||
$haproxy_members_raw = query_nodes($haproxy_query, 'networking.ip')
|
||||
$haproxy_members_raw = puppetdb_query(
|
||||
"inventory[networking.ip] {
|
||||
facts.enc_role = '${haproxy_role}' and
|
||||
facts.country = '${facts['country']}' and
|
||||
facts.region = '${facts['region']}'
|
||||
}"
|
||||
).map |$node| { $node['networking.ip'] }
|
||||
$haproxy_ips = $haproxy_members_raw ? {
|
||||
undef => [],
|
||||
default => sort($haproxy_members_raw),
|
||||
|
||||
Reference in New Issue
Block a user