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: I2040c143466baade6d2810c737aee412b34aa728
This commit is contained in:
Dmitriy Rabotyagov 2024-07-22 15:18:45 +02:00
parent 19cd4a066a
commit 8b68114626

View File

@ -16,13 +16,13 @@
_designate_is_first_play_host: >-
{{
(designate_services['designate-api']['group'] in group_names and
inventory_hostname == (groups[designate_services['designate-api']['group']] | intersect(ansible_play_hosts)) | first) | bool
inventory_hostname == (groups[designate_services['designate-api']['group']] | select('in', ansible_play_hosts)) | first) | bool
}}
_designate_is_last_play_host: >-
{{
(designate_services['designate-api']['group'] in group_names and
inventory_hostname == (groups[designate_services['designate-api']['group']] | intersect(ansible_play_hosts)) | last) | bool
inventory_hostname == (groups[designate_services['designate-api']['group']] | select('in', ansible_play_hosts)) | last) | bool
}}
_designate_oslomsg_rpc_vhost_conf: >-