diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-06-11 10:35:02 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-06-11 10:36:11 +0300 |
commit | d3cc1208bf714b63ab48e39a1d448e1b278b57f1 (patch) | |
tree | 915ec983fc757a3ebf2375883be62ac657efb3fe /ansible/roles | |
parent | fd734b1e3659cd939235c89121777fafd62f57b3 (diff) | |
download | ansibleness-d3cc1208bf714b63ab48e39a1d448e1b278b57f1.tar.gz |
fix(liw): create ~liw/.ssh and known_hosts if missing
Sponsored-by: author
Diffstat (limited to 'ansible/roles')
-rw-r--r-- | ansible/roles/liw/tasks/main.yml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ansible/roles/liw/tasks/main.yml b/ansible/roles/liw/tasks/main.yml index 01b90d7..916d140 100644 --- a/ansible/roles/liw/tasks/main.yml +++ b/ansible/roles/liw/tasks/main.yml @@ -8,6 +8,13 @@ sudo -u liw -i bash -c "pwd && ./liw-dot-files/make-symlinks" sudo -u liw -i bash -c "ln -nsf liw-dot-files/gitconfig-exolobe1 .gitconfig" +- name: "make sure ~liw/.ssh/known_hosts exists" + shell: | + dir=/home/liw/.ssh + k="$dir/known_hosts" + if ! [ -e "$dir" ]; then install -d -o liw -g liw -m 0755 "$dir"; fi + if ! [ -e "$k" ]; then touch "$k"; fi + - name: "configure liw SSH known hosts" lineinfile: line: "@cert-authority * ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIW1QmBC3OLsjpUv1gIYBHSN5tWhPOHHzDIXgj8d1Hg1" |