From 9286e431ab3b42dfa15666d76a8a148d98fbbae9 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 9 Nov 2022 21:16:21 -0600 Subject: [PATCH] ci: Use SSH host keys from ssh-hostkeys role I don't know why I didn't think of this before! There's no reason to have to have already copied the `ssh_known_hosts` file from to `/etc/ssh` before running `ansible-playbook`. In fact, keys just end up getting copied from `/etc/ssh/ssh_known_hosts` into `~/.ssh/known_hosts` anyway. So let's just make it so that step isn't necessary: copy the host key database directly to `~/.ssh` and avoid the trouble. --- vars/applyConfigPolicy.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vars/applyConfigPolicy.groovy b/vars/applyConfigPolicy.groovy index e879f4e..189f0f3 100644 --- a/vars/applyConfigPolicy.groovy +++ b/vars/applyConfigPolicy.groovy @@ -54,6 +54,8 @@ def stageKinit() { sh 'cp "${SUDO_PASS_FILE}" group_vars/pyrocufflink/sudo-pass' } sh 'rm -rf .fact-cache' + sh 'install -m u=rwx,go= -d ~/.ssh' + sh 'cp roles/ssh-hostkeys/files/ssh_known_hosts ~/.ssh/known_hosts' } }