Ensure that first/last host detection is deterministic

With ansible-core 2.16 a breaking changes landed [1] to some filters
making their result returned in arbitrary order. With that, we were
relying on them to always return exactly same ordered lists.

With that we need to ensure that we still have determenistic behaviour
where this is important.

[1] https://github.com/ansible/ansible/issues/82554

Signed-off-by: Dmitriy Rabotyagov <noonedeadpunk@gmail.com>
Change-Id: I972760c2dfb2584d41822fa644e8e0047c5d9c63
This commit is contained in:
Dmitriy Rabotyagov
2024-07-22 14:22:13 +02:00
parent 542e17fb0d
commit 31264633ec

View File

@@ -16,7 +16,7 @@
_adjutant_is_first_play_host: >-
{{
(adjutant_services['adjutant-api']['group'] in group_names and
inventory_hostname == (groups[adjutant_services['adjutant-api']['group']] | intersect(ansible_play_hosts)) | first) | bool
inventory_hostname == (groups[adjutant_services['adjutant-api']['group']] | select('in', ansible_play_hosts)) | first) | bool
}}
filtered_adjutant_services: |-