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:
@@ -30,13 +30,14 @@ class profiles::haproxy::dns (
|
||||
}
|
||||
|
||||
# if it is, find hosts, sort them so they dont cause changes every run
|
||||
$servers_array = sort(query_nodes(
|
||||
"enc_role='${facts['enc_role']}' and
|
||||
country='${facts['country']}' and
|
||||
region='${facts['region']}' and
|
||||
environment='${facts['environment']}'",
|
||||
'networking.fqdn'
|
||||
))
|
||||
$servers_array = sort(puppetdb_query(
|
||||
"facts[certname] {
|
||||
name = 'enc_role' and value = '${facts['enc_role']}' 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 = 'environment' and value = '${facts['environment']}' }
|
||||
}"
|
||||
).map |$fact| { $fact['certname'] })
|
||||
|
||||
# give enough time for a few hosts to be provisioned
|
||||
if length($servers_array) >= 3 {
|
||||
|
||||
Reference in New Issue
Block a user