From 7ffe4c5abe5247051950416a16bfbcf03089de2b Mon Sep 17 00:00:00 2001 From: Julien Girardin Date: Thu, 7 Dec 2023 11:34:32 +0100 Subject: [PATCH] Detect changes on all nodes, for triggering "pause" on review https://docs.ansible.com/ansible/latest/collections/ansible/builtin/pause_module.html "Conditionals will work as if run_once is being used, variables used will be from the first available host" --- roles/process_reasons/tasks/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/process_reasons/tasks/main.yml b/roles/process_reasons/tasks/main.yml index e98dbd1..bc7f684 100644 --- a/roles/process_reasons/tasks/main.yml +++ b/roles/process_reasons/tasks/main.yml @@ -21,7 +21,8 @@ - name: 'Pause to review diff and upgrade reasons' pause: when: - - _upgrade_reasons|length > 0 or _config_upgrade_reasons|length > 0 + - ansible_play_hosts_all|map('extract', hostvars, '_upgrade_reasons')|map('default', [])|map('length')|select|list|length > 0 + or ansible_play_hosts_all|map('extract', hostvars, '_config_upgrade_reasons')|map('default', [])|map('length')|select|list|length > 0 - groups.cp_running|default([])|length > 0 - not action_reasons_review_skip|bool