From 1335990b9aa0f0563276d23caac9ff15ee23c560 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Thu, 6 Jul 2017 12:55: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: Ie043fca77d98ce55edb84547b06be0001d7311ea --- tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index b60d6ff7..bcb14ec9 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -52,7 +52,7 @@ static: no when: - "'glance_api' in group_names" - - "inventory_hostname == ansible_play_hosts[0]" + - "inventory_hostname == (groups['glance_api'] | intersect(ansible_play_hosts))[0]" tags: - glance-config @@ -60,7 +60,7 @@ static: no when: - "'glance_api' in group_names" - - "inventory_hostname == ansible_play_hosts[0]" + - "inventory_hostname == (groups['glance_api'] | intersect(ansible_play_hosts))[0]" tags: - glance-config