From c51cce0c4a3cf16e40cf61f3d08f4333ae2c05c9 Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Thu, 20 Dec 2018 16:10:29 +0000 Subject: [PATCH] Look for lower-case hostname when adding to ssh_known_hosts We need to normalize hostnames to lower-case in order to avoid case discrepancies. Change-Id: Iaf73f9ae346425881e70500cf3ee28599fc4171a Partial-Bug: 1809273 (cherry picked from commit c71d234bf8a4a9f23ace6a29ebc570c390a2f7b3) --- roles/tripleo-ssh-known-hosts/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/tripleo-ssh-known-hosts/tasks/main.yml b/roles/tripleo-ssh-known-hosts/tasks/main.yml index b4f53197b..7430ad62c 100644 --- a/roles/tripleo-ssh-known-hosts/tasks/main.yml +++ b/roles/tripleo-ssh-known-hosts/tasks/main.yml @@ -3,7 +3,7 @@ become: true lineinfile: path: /etc/ssh/ssh_known_hosts - line: "{{ ssh_known_hosts[hostvars[item]['ansible_hostname']] + ' ssh-rsa ' + hostvars[item]['ansible_ssh_host_key_rsa_public'] }}" + line: "{{ ssh_known_hosts[hostvars[item]['ansible_hostname'] | lower] + ' ssh-rsa ' + hostvars[item]['ansible_ssh_host_key_rsa_public'] }}" create: yes with_items: "{{ groups['overcloud']|intersect(play_hosts) }}" tags: