Add support to generate inventory for OSP17

This patch specifies the overcloud_stack_name
to  generate inventory.

Change-Id: Id6f8244a77b0e805507588f154e21a39fd07e3c7
This commit is contained in:
Asma Syed Hameed 2022-02-11 15:18:43 +05:30
parent e043181084
commit bbf6e1f09b

View File

@ -12,6 +12,7 @@ function usage
} }
user="stack" user="stack"
overcloud_stack_name=overcloud
uncomment_localhost=false uncomment_localhost=false
tripleo_ip_address= tripleo_ip_address=
@ -44,9 +45,9 @@ fi
out_file="hosts.yml" out_file="hosts.yml"
if [ $uncomment_localhost ]; then if [ $uncomment_localhost ]; then
source ~/stackrc source ~/stackrc
tripleo-ansible-inventory --static-yaml-inventory ${out_file} tripleo-ansible-inventory --stack ${overcloud_stack_name} --static-yaml-inventory ${out_file}
else else
file_path=$(ssh -tt -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" ${user}@${tripleo_ip_address} ". ~/stackrc; tripleo-ansible-inventory --static-yaml-inventory ${out_file}; pwd ${out_file}") file_path=$(ssh -tt -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" ${user}@${tripleo_ip_address} ". ~/stackrc; tripleo-ansible-inventory --stack ${overcloud_stack_name} --static-yaml-inventory ${out_file}; pwd ${out_file}")
scp -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" ${user}@${tripleo_ip_address}:${file_path}/${out_file} . scp -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" ${user}@${tripleo_ip_address}:${file_path}/${out_file} .
fi fi