From f3da3d8e1920473154d239e6ef5a254dbde438f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Sat, 24 Apr 2021 18:34:27 +0000 Subject: [PATCH] Avoid an Ansible quirk in hacluster role Followup on I91e5c1840ace8f567daf462c4eb3ec1f0c503823 When+run_once do not play nicely. [1] The general workaround is to use include_tasks. [2] However, it is very unlikely user wishes to run this role without having any pacemaker nodes so the simplification that we use throughout the Kolla Ansible code should be enough. [1] https://github.com/ansible/ansible/issues/11496 [2] https://github.com/ansible/ansible/issues/11496#issuecomment-412936547 Change-Id: Ifaf64e3d9d89b2ec36a883fb7458556745b64802 --- ansible/roles/hacluster/tasks/bootstrap_service.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ansible/roles/hacluster/tasks/bootstrap_service.yml b/ansible/roles/hacluster/tasks/bootstrap_service.yml index 2963592277..8bf67213b9 100644 --- a/ansible/roles/hacluster/tasks/bootstrap_service.yml +++ b/ansible/roles/hacluster/tasks/bootstrap_service.yml @@ -5,9 +5,7 @@ command: docker exec {{ service.container_name }} crm_attribute --type crm_config --name stonith-enabled --update false run_once: true become: true - when: - - inventory_hostname in groups[service.group] - - service.enabled | bool + delegate_to: "{{ groups[service.group][0] }}" - name: Ensure remote node is added vars: