From 300f90134e7d4bdc298cc050d60f67476145c87b Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Thu, 18 Jul 2019 15:17:24 +0100 Subject: [PATCH] Only set up the kolla ansible venv on hosts in the kolla ansible inventory Change-Id: Iaed6320f23a4dfe7a69e2921d363bf3bdcf035ef Story: 2006247 Task: 35856 --- ansible/kolla-target-venv.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ansible/kolla-target-venv.yml b/ansible/kolla-target-venv.yml index af15dd443..02abdb68a 100644 --- a/ansible/kolla-target-venv.yml +++ b/ansible/kolla-target-venv.yml @@ -5,6 +5,15 @@ - name: Ensure a virtualenv exists for kolla-ansible hosts: seed:overcloud gather_facts: False + vars: + # kolla_overcloud_inventory_top_level_group_map looks like: + # kolla_overcloud_inventory_top_level_group_map: + # control: + # groups: + # - controllers + overcloud_nodes_in_kolla_inventory: >- + {{ kolla_overcloud_inventory_top_level_group_map.values() | + map(attribute='groups') | flatten | unique | join(':') }} tags: - kolla-ansible - kolla-target-venv @@ -42,4 +51,6 @@ owner: "{{ kolla_ansible_user }}" group: "{{ kolla_ansible_group }}" become: True - when: kolla_ansible_target_venv is not none + when: + - kolla_ansible_target_venv is not none + - inventory_hostname in query('inventory_hostnames', overcloud_nodes_in_kolla_inventory)