From cdb408b79f64d7afdae9322f4fa8fe15ad9a090a Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Thu, 6 Jul 2017 13:04:38 +0100 Subject: [PATCH] Improve inventory scoping for limited play execution When executing the playbook with limits set, the scoping currently does not work quite as well as one would hope. This tightens it a bit more to ensure that it operates as expected. Change-Id: I1bae819d06df0f58907659ae21b26798373dda42 --- tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 27d0a7e9..c7552c4e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -64,7 +64,7 @@ static: no when: - "'nova_conductor' in group_names" - - "inventory_hostname == ansible_play_hosts[0]" + - "inventory_hostname == (groups['nova_conductor'] | intersect(ansible_play_hosts))[0]" tags: - nova-config @@ -76,7 +76,7 @@ static: no when: - "'nova_conductor' in group_names" - - "inventory_hostname == ansible_play_hosts[0]" + - "inventory_hostname == (groups['nova_conductor'] | intersect(ansible_play_hosts))[0]" tags: - nova-config