From b3fad83fd5f9398aad51fc93e076c694411913a8 Mon Sep 17 00:00:00 2001 From: Oliver Walsh Date: Tue, 21 Jan 2020 15:51:27 +0000 Subject: [PATCH] Fix the ctlplane_ip in ssh_known_hosts entries This should be ctlplane_ip for the host in question, not the current host. Change-Id: I19587c760d7fcc0313e97c1708da901f8e75c394 Closes-bug: #1860451 --- tripleo_ansible/roles/tripleo_ssh_known_hosts/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tripleo_ansible/roles/tripleo_ssh_known_hosts/tasks/main.yml b/tripleo_ansible/roles/tripleo_ssh_known_hosts/tasks/main.yml index 4a8b412ae..c7f7f5b24 100644 --- a/tripleo_ansible/roles/tripleo_ssh_known_hosts/tasks/main.yml +++ b/tripleo_ansible/roles/tripleo_ssh_known_hosts/tasks/main.yml @@ -50,8 +50,8 @@ {% for host in (groups['overcloud'] | intersect(play_hosts)) %} {% set hostdata = hostvars[host] %} {% if ('ansible_ssh_host_key_rsa_public' in hostdata) or (ansible_ssh_host_key_rsa_public is defined) %} - {% if (cloud_domain is defined) and (ctlplane_ip is defined) %} - {% set line = '[' ~ ctlplane_ip ~ ']*,[' ~ host ~ '.' ~ cloud_domain ~ ']*,[' ~ host ~ ']*' %} + {% if (cloud_domain is defined) and (hostdata['ctlplane_ip'] is defined) %} + {% set line = '[' ~ hostdata['ctlplane_ip'] ~ ']*,[' ~ host ~ '.' ~ cloud_domain ~ ']*,[' ~ host ~ ']*' %} {% set role_networks = hostdata['role_networks'] | default([]) %} {% if ((enabled_networks is defined and enabled_networks) and ((enabled_networks | length) > 0)) %} {% if ((role_networks is defined and role_networks) and ((role_networks | length) > 0)) %}