From 153ce732de3f84bdc80daac9a5913ce643a6ca19 Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Mon, 5 Jun 2017 23:34:27 +0800 Subject: Fix bug in apex module - the default user may not be `root` - gather facts is required for getting $HOME Change-Id: Ibe7ba31322f07f0a9fa33a01005e605dc7eb796a Signed-off-by: Yujun Zhang --- resources/ansible_roles/qtip-generator/files/compute/setup.yml | 1 - resources/ansible_roles/qtip/tasks/gather-facts-apex.yml | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/ansible_roles/qtip-generator/files/compute/setup.yml b/resources/ansible_roles/qtip-generator/files/compute/setup.yml index d1ab2638..f5920c1f 100644 --- a/resources/ansible_roles/qtip-generator/files/compute/setup.yml +++ b/resources/ansible_roles/qtip-generator/files/compute/setup.yml @@ -17,7 +17,6 @@ - debug: "msg='please add hosts to SUT group in `hosts` file manually.'" {% else %} - hosts: [{{ installer_group[installer_type] }}] - gather_facts: no roles: - { role: qtip, tasks: generate-inventory } {% endif %} diff --git a/resources/ansible_roles/qtip/tasks/gather-facts-apex.yml b/resources/ansible_roles/qtip/tasks/gather-facts-apex.yml index f7112554..a5799f3d 100644 --- a/resources/ansible_roles/qtip/tasks/gather-facts-apex.yml +++ b/resources/ansible_roles/qtip/tasks/gather-facts-apex.yml @@ -10,11 +10,11 @@ --- - name: gathering overcloud baremetal info - shell: . /root/stackrc && openstack baremetal list --fields instance_uuid properties provision_state --format json + shell: "source {{ ansible_env.HOME}}/stackrc && openstack baremetal list --fields instance_uuid properties provision_state --format json" register: baremetal_info - name: gathering overcloud server info - shell: . /root/stackrc && openstack server list --format json + shell: "source {{ ansible_env.HOME }}/stackrc && openstack server list --format json" register: server_info - name: generating inventory -- cgit 1.2.3-korg