From 45f66c28b89e283d5d9aa55b969ec4305d5d75c8 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Mon, 22 Jul 2024 16:18:24 +0200 Subject: [PATCH] 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 --- vars/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars/main.yml b/vars/main.yml index 23a65736..ff296113 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -16,10 +16,10 @@ _swift_proxy_is_first_play_host: >- {{ (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_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: >- {{