Skip to content

Commit 1850c71

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Fix known_hosts module issue on centos/rocky 10" into stable/2025.1
2 parents c12519b + 85ad72a commit 1850c71

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ansible/roles/bootstrap/tasks/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@
6161
user: "{{ ansible_facts.user_id }}"
6262
key: "{{ lookup('file', bootstrap_ssh_private_key_path ~ '.pub') }}"
6363

64+
# NOTE(priteau): Exclude comments from ssh-keyscan output because they break
65+
# known_hosts on centos/rocky 10.
6466
- name: Scan for SSH keys
65-
command: ssh-keyscan {{ item }}
67+
shell: ssh-keyscan {{ item }} | grep -v '^#'
6668
with_items:
6769
- localhost
6870
- 127.0.0.1

ansible/roles/ssh-known-host/tasks/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
vm provision' and 'kayobe overcloud inventory discover'.
1414
when: not ansible_host | default(inventory_hostname)
1515

16+
# NOTE(priteau): Exclude comments from ssh-keyscan output because they break
17+
# known_hosts on centos/rocky 10.
1618
- name: Scan for SSH keys
1719
local_action:
18-
module: command ssh-keyscan {{ item }}
20+
module: shell ssh-keyscan {{ item }} | grep -v '^#'
1921
with_items:
2022
- "{{ ansible_host|default(inventory_hostname) }}"
2123
register: keyscan_result

0 commit comments

Comments
 (0)