Skip to content

Commit

Permalink
make object-collection deterministic in icinga2::query_objects
Browse files Browse the repository at this point in the history
Sort all objects by title, so the order will stable and not produce huge
changesets by random chance.
  • Loading branch information
sircubbi committed Mar 28, 2023
1 parent 42f895e commit 9d93c0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/query_objects.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
} # default
}

$pql_query = puppetdb_query("resources[parameters] { environment in ['${_environments}'] and type = 'Icinga2::Object' and exported = true and tag = 'icinga2::instance::${destination}' and nodes { deactivated is null and expired is null } order by certname }")
$pql_query = puppetdb_query("resources[parameters] { environment in ['${_environments}'] and type = 'Icinga2::Object' and exported = true and tag = 'icinga2::instance::${destination}' and nodes { deactivated is null and expired is null } order by certname, title }")

$file_list = $pql_query.map |$object| {
$object['parameters']['target']
Expand Down

0 comments on commit 9d93c0a

Please sign in to comment.