Add-sshkey: ensure that ssh home directory exists

Some images might not have pre-created that directory, hence failing the task.
This simple step will prevent that.

Change-Id: Id2b63e84ef047f02127772c4d45b55ec360436f8
This commit is contained in:
Haikel Guemar 2020-09-01 14:43:00 +02:00
parent b13b925eff
commit 54bf1abaa4
1 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,9 @@
- name: Ensure that ssh home directory exists
file:
path: "~/.ssh"
state: directory
mode: 0700
- name: Write out ssh key
copy:
dest: "~/.ssh/id_rsa"