Fix ssh to nodes during ML2/OVS to ML2/OVN migration

Migration ansible playbooks are not able to connect to overcloud
nodes using ssh due to bad settings in the generated ansible
inventory file. Ctlplane subnet ip addresses should be used by
ansible in order to be able to establish connection successfully.

Closes-bug: #1881029
Change-Id: I1588b88279ba1e25706cc74f4a888901e5aadcb6
This commit is contained in:
Roman Safronov 2020-05-28 01:19:41 +03:00 committed by Brian Haley
parent 685d3dc50b
commit 0402337c15

View File

@ -77,7 +77,7 @@ file again."
get_host_ip() { get_host_ip() {
inventory_file=$1 inventory_file=$1
host_name=$2 host_name=$2
ip=`jq -r --arg role _meta --arg hostname $host_name 'to_entries[] | select(.key == $role) | .value.hostvars[$hostname].management_ip' $inventory_file` ip=`jq -r --arg role _meta --arg hostname $host_name 'to_entries[] | select(.key == $role) | .value.hostvars[$hostname].ansible_host' $inventory_file`
if [[ "x$ip" == "x" ]] || [[ "x$ip" == "xnull" ]]; then if [[ "x$ip" == "x" ]] || [[ "x$ip" == "xnull" ]]; then
# This file does not provide translation from the hostname to the IP, or # This file does not provide translation from the hostname to the IP, or
# we already have an IP (Queens backwards compatibility) # we already have an IP (Queens backwards compatibility)