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,7 +18,9 @@ class profiles::etcd::node (
|
||||
}
|
||||
|
||||
# if it is, find hosts, sort them so they dont cause changes every run
|
||||
$servers_array = sort(query_nodes("enc_role='${members_role}' and region='${facts['region']}'", 'networking.fqdn'))
|
||||
$servers_array = sort(puppetdb_query(
|
||||
"inventory[networking.fqdn] { facts.enc_role = '${members_role}' and facts.region = '${facts['region']}' }"
|
||||
).map |$node| { $node['networking.fqdn'] })
|
||||
|
||||
# else use provided array from params
|
||||
}else{
|
||||
@@ -31,7 +33,7 @@ class profiles::etcd::node (
|
||||
$initial_cluster = $servers_array.map |$fqdn| {
|
||||
|
||||
# lookup the ip address for the current fqdn
|
||||
$ip = query_nodes("networking.fqdn='${fqdn}'", 'networking.ip')[0]
|
||||
$ip = puppetdb_query("inventory[networking.ip] { networking.fqdn = '${fqdn}' }").map |$node| { $node['networking.ip'] }[0]
|
||||
|
||||
# construct the string for this server
|
||||
"${fqdn}=https://${ip}:${peer_port}"
|
||||
|
||||
Reference in New Issue
Block a user