Skip to content

Commit 541906f

Browse files
committed
fix OOD login host keys in known_hosts
1 parent 6cae5ec commit 541906f

File tree

1 file changed

+6
-6
lines changed
  • ansible/roles/openondemand/tasks

1 file changed

+6
-6
lines changed

ansible/roles/openondemand/tasks/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,16 @@
131131

132132
- name: Keyscan login host
133133
command:
134-
cmd: "ssh-keyscan -t ssh-ed25519 {{ openondemand_clusters.slurm.v2.login.host }}"
134+
cmd: "ssh-keyscan {{ openondemand_clusters.slurm.v2.login.host }}"
135135
register: _openondemand_login_key
136136
changed_when: false
137137

138-
- name: Add login hostkey to known hosts
139-
lineinfile:
140-
path: /etc/ssh/known_hosts
138+
- name: Add login hostkeys to known hosts
139+
blockinfile:
140+
path: /etc/ssh/ssh_known_hosts
141141
create: true
142-
line: "{{ _openondemand_login_key.stdout }}"
143-
regexp: "^{{ openondemand_clusters.slurm.v2.login.host}}"
142+
block: "{{ _openondemand_login_key.stdout }}"
143+
marker: "# {mark} ANSIBLE MANGED BLOCK: openondemand login host" # allows other tasks to use blockinfile on this file
144144
owner: root
145145
group: root
146146
mode: o=rw,go=r

0 commit comments

Comments
 (0)