Fix workaround delegation when overcloud's name is not overcloud.
tripleo-ansible-inventory use overcloud as the name of the stack by default. On some ci, that value may be different, this then produces an undercloud only inventory file. Change-Id: Ic420c0717165e01df99ad2368a23fc9fc10e71c1 Closes-Bug: #1857120 (cherry picked from commit6483436d7d
) (cherry picked from commit1da968309d
)
This commit is contained in:
parent
81035c28da
commit
889259d861
|
@ -47,6 +47,7 @@ function ansible_patch {
|
||||||
local ansible_filename=$1
|
local ansible_filename=$1
|
||||||
local ansible_limit=""
|
local ansible_limit=""
|
||||||
local ansible_ssh_user="heat-admin"
|
local ansible_ssh_user="heat-admin"
|
||||||
|
local overcloud_stack_name="overcloud"
|
||||||
local ansible_dir=$HOME/ansible_workarounds
|
local ansible_dir=$HOME/ansible_workarounds
|
||||||
|
|
||||||
if [ ! -z $LIMIT ]
|
if [ ! -z $LIMIT ]
|
||||||
|
@ -57,11 +58,14 @@ function ansible_patch {
|
||||||
then
|
then
|
||||||
ansible_ssh_user=$ANSIBLE_SSH_USER
|
ansible_ssh_user=$ANSIBLE_SSH_USER
|
||||||
fi
|
fi
|
||||||
|
if [ -n "${OVERCLOUD_STACK_NAME}" ];
|
||||||
|
then
|
||||||
|
overcloud_stack_name="${OVERCLOUD_STACK_NAME}"
|
||||||
|
fi
|
||||||
inventory_file=${ansible_dir}/tripleo-inventory.yaml
|
inventory_file=${ansible_dir}/tripleo-inventory.yaml
|
||||||
if [ ! -f "$inventory_file" ]; then
|
if [ ! -f "$inventory_file" ]; then
|
||||||
source {{ undercloud_rc }}
|
source {{ undercloud_rc }}
|
||||||
tripleo-ansible-inventory --ansible_ssh_user ${ansible_ssh_user} --static-yaml-inventory ${inventory_file}
|
tripleo-ansible-inventory --plan "${overcloud_stack_name}" --ansible_ssh_user ${ansible_ssh_user} --static-yaml-inventory ${inventory_file}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run ansible playbook
|
# Run ansible playbook
|
||||||
|
@ -72,6 +76,7 @@ function ansible_patch {
|
||||||
# Global vars
|
# Global vars
|
||||||
LIMIT=""
|
LIMIT=""
|
||||||
ANSIBLE_SSH_USER=""
|
ANSIBLE_SSH_USER=""
|
||||||
|
OVERCLOUD_STACK_NAME="{{ overcloud_stack_name }}"
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]
|
while [[ $# -gt 0 ]]
|
||||||
do
|
do
|
||||||
|
@ -88,6 +93,11 @@ case $key in
|
||||||
shift # past argument
|
shift # past argument
|
||||||
shift # past value
|
shift # past value
|
||||||
;;
|
;;
|
||||||
|
-o|--overcloud-stack-name)
|
||||||
|
OVERCLOUD_STACK_NAME="$2"
|
||||||
|
shift # past argument
|
||||||
|
shift # past value
|
||||||
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in New Issue