From bfd4651fe5a0d5072a772b1deae91f4568d0fd6f Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Fri, 19 Jul 2024 11:01:26 +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: I76fd03a9584b5999af6cb247f8a3f67d5343b055 --- vars/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars/main.yml b/vars/main.yml index 609a793b..a768782f 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -38,12 +38,12 @@ uwsgi_keystone_services: |- _keystone_is_first_play_host: >- {{ (keystone_services['keystone-wsgi-public']['group'] in group_names and - inventory_hostname == ((groups[keystone_services['keystone-wsgi-public']['group']] | intersect(ansible_play_hosts)) | list)[0]) | bool + inventory_hostname == ((groups[keystone_services['keystone-wsgi-public']['group']] | select('in', ansible_play_hosts)) | list)[0]) | bool }} _keystone_is_last_play_host: >- {{ (keystone_services['keystone-wsgi-public']['group'] in group_names and - inventory_hostname == ((groups[keystone_services['keystone-wsgi-public']['group']] | intersect(ansible_play_hosts)) | list)[-1]) | bool + inventory_hostname == ((groups[keystone_services['keystone-wsgi-public']['group']] | select('in', ansible_play_hosts)) | list)[-1]) | bool }} _keystone_oslomsg_rpc_vhost_conf: >-