diff options
author | Jakub Libosvar <libosvar@redhat.com> | 2022-03-23 12:28:45 -0400 |
---|---|---|
committer | Jakub Libosvar <libosvar@redhat.com> | 2022-03-23 12:28:45 -0400 |
commit | 5b2fd1f830827105bcaca0d4ba5da05b8b71c515 (patch) | |
tree | 12b6bb73fc2882e29e015c15b65ead9dcf7af2c8 /tools | |
parent | 1b68aebaba05b5db23e9e81a9a03cdf43f3eb06c (diff) | |
download | neutron-5b2fd1f830827105bcaca0d4ba5da05b8b71c515.tar.gz |
ovn migration: Remove usage of tripleo-ansible-inventory
tripleo-ansible-inventory stopped working in Wallaby. However, TripleO
now stores the needed ansible-inventory on the undercloud filesystem.
This patch switches from dynamic generation of the Ansible inventory to
use of the already existing inventory file. Fortunately, the format of
the file remained the same as the generated one, so no other changes in
parsing are required.
Closes-Bug: #1966099
Change-Id: I3bdf878617fbe962d56ebb66d59ae7edeb9b7c38
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ovn_migration/tripleo_environment/ovn_migration.sh | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tools/ovn_migration/tripleo_environment/ovn_migration.sh b/tools/ovn_migration/tripleo_environment/ovn_migration.sh index 9aeda70ef9..58219b8061 100644 --- a/tools/ovn_migration/tripleo_environment/ovn_migration.sh +++ b/tools/ovn_migration/tripleo_environment/ovn_migration.sh @@ -34,6 +34,7 @@ LANG=C : ${OPT_WORKDIR:=$PWD} : ${STACK_NAME:=overcloud} +: ${OOO_WORKDIR:=$HOME/overcloud-deploy} : ${PUBLIC_NETWORK_NAME:=public} : ${IMAGE_NAME:=cirros} : ${FLAVOR_NAME:=ovn-migration} @@ -147,13 +148,11 @@ EOF # Generate the inventory file for ansible migration playbook. generate_ansible_inventory_file() { local dhcp_nodes + local inventory_file="$OOO_WORKDIR/$STACK_NAME/config-download/$STACK_NAME/tripleo-ansible-inventory.yaml" echo "Generating the inventory file for ansible-playbook" - source $STACKRC_FILE echo "[ovn-dbs]" > hosts_for_migration ovn_central=True - inventory_file=$(mktemp --tmpdir ansible-inventory-XXXXXXXX.yaml) - /usr/bin/tripleo-ansible-inventory --stack $STACK_NAME --static-yaml-inventory "$inventory_file" # We want to run ovn_dbs where neutron_api is running OVN_DBS=$(get_group_hosts "$inventory_file" neutron_api) for node_name in $OVN_DBS; do @@ -184,7 +183,6 @@ generate_ansible_inventory_file() { echo $node_name ansible_host=$node_ip ansible_ssh_user=$UNDERCLOUD_NODE_USER ansible_become=true >> hosts_for_migration done - rm -f "$inventory_file" echo "" >> hosts_for_migration cat >> hosts_for_migration << EOF @@ -228,12 +226,11 @@ EOF # Check if the stack exists function check_stack { - source $STACKRC_FILE - openstack stack show $STACK_NAME 1> /dev/null || { + if [ ! -d $OOO_WORKDIR/$STACK_NAME/config-download/$STACK_NAME ]; then echo "ERROR: STACK_NAME=${STACK_NAME} does not exist. Please provide the stack name or its ID " echo " via STACK_NAME environment variable." exit 1 - } + fi } # Check if the public network exists, and if it has floating ips available |