Skip to content

Commit

Permalink
Merge pull request #331 from stackhpc/feat/ood-sshkey
Browse files Browse the repository at this point in the history
Avoid prompting user to accept hostkey in OOD shell
  • Loading branch information
sjpb authored Dec 15, 2023
2 parents 2abd860 + 70a9364 commit 81ef85f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
16 changes: 16 additions & 0 deletions ansible/roles/openondemand/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,19 @@
# loop:
# - /var/www/ood/public
# - /usr/share/ondemand-dex/web/themes/

- name: Keyscan login host
command:
cmd: "ssh-keyscan {{ openondemand_clusters.slurm.v2.login.host }}"
register: _openondemand_login_key
changed_when: false

- name: Add login hostkeys to known hosts
blockinfile:
path: /etc/ssh/ssh_known_hosts
create: true
block: "{{ _openondemand_login_key.stdout_lines | sort | join('\n') }}"
marker: "# {mark} ANSIBLE MANAGED BLOCK: openondemand login host" # allows other tasks to use blockinfile on this file
owner: root
group: root
mode: o=rw,go=r
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ openondemand_dashboard_links_grafana:
url: "{{ grafana_url_openondemand_proxy }}"
openondemand_dashboard_links: "{{ openondemand_dashboard_links_grafana if groups['grafana'] | length > 0 }}"

openondemand_login_host: localhost

openondemand_clusters:
slurm:
v2:
metadata:
title: "{{ openhpc_cluster_name }}" # interpolation here works as openondemand is lexically after openhpc
login:
host: "{{ hostvars[groups['login'].0].api_address }}"
host: "{{ openondemand_login_host }}"
default: true
job:
adapter: slurm
Expand Down

0 comments on commit 81ef85f

Please sign in to comment.