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 c71d234bf8)
(cherry picked from commit c51cce0c4a)
This commit is contained in:
Ben Nemec 2018-12-20 16:10:29 +00:00 committed by Oliver Walsh
parent d02470c9fa
commit eae3867fc7
1 changed files with 1 additions and 1 deletions

View File

@ -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: