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

Change-Id: Ia1a84f97ac86cfb621cd50958ff8eaf55655596e
This commit is contained in:
Dmitriy Rabotyagov 2024-07-22 16:18:24 +02:00
parent 953aafcdb8
commit 45f66c28b8

View File

@ -16,10 +16,10 @@
_swift_proxy_is_first_play_host: >- _swift_proxy_is_first_play_host: >-
{{ {{
(swift_services['swift-proxy-server']['group'] in group_names and (swift_services['swift-proxy-server']['group'] in group_names and
inventory_hostname == (groups[swift_services['swift-proxy-server']['group']] | intersect(ansible_play_hosts)) | first) | bool inventory_hostname == (groups[swift_services['swift-proxy-server']['group']] | select('in', ansible_play_hosts)) | first) | bool
}} }}
_swift_is_first_play_host: >- _swift_is_first_play_host: >-
{{ ('swift_hosts' in group_names and inventory_hostname == (groups['swift_hosts'] | intersect(ansible_play_hosts)) | first) | bool }} {{ ('swift_hosts' in group_names and inventory_hostname == (groups['swift_hosts'] | select('in', ansible_play_hosts)) | first) | bool }}
_swift_oslomsg_notify_vhost_conf: >- _swift_oslomsg_notify_vhost_conf: >-
{{ {{