From 492005071abfcb010292ad464cb26ecb2babef25 Mon Sep 17 00:00:00 2001 From: Rabi Mishra Date: Tue, 2 Aug 2022 22:27:51 +0530 Subject: [PATCH] Use conditions with Host prep block tasks Ansible free/tripleo_free strategies do not work well for blocks with conditions, containing include_tasks. Conditions ( i.e when: ) at times get mixed up resulting in wrong condition being evaluated. As blocks are only logical entities (conditions evaluated per task), we shouldn't have any problem moving the conditions to tasks in Host prep block to avoid the issue. This fixes intermittent chrony failures in host_prep_tasks. Note: This is a workaround as we've to backport it all the way till train and has to be fixed in core ansible[1] in the future. [1] https://github.com/ansible/ansible/issues/60512 Resolves: rhbz#2084075 Resolves: rhbz#2111237 Change-Id: Id9f481f3fe75169bd4c3d721e23e847a1b6c8c43 (cherry picked from commit e728e8cc8e2442b092c3f4f5d6e0296a779cd3dd) --- common/deploy-steps.j2 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2 index e7533d1741..ac68f431b7 100644 --- a/common/deploy-steps.j2 +++ b/common/deploy-steps.j2 @@ -686,15 +686,18 @@ outputs: {% endraw %} {%- for role in roles %} - name: {{role.name}} Host prep block - when: - - tripleo_role_name == '{{role.name}}' block: - name: {{role.name}} Host prep steps delegate_to: localhost run_once: true debug: msg: Use --start-at-task '{{role.name}} Host prep steps' to resume from this task - - include_tasks: {{role.name}}/host_prep_tasks.yaml + when: + - tripleo_role_name == '{{role.name}}' + - name: {{role.name}} Host prep tasks + include_tasks: {{role.name}}/host_prep_tasks.yaml + when: + - tripleo_role_name == '{{role.name}}' {%- endfor %} tags: - overcloud