From 54bf1abaa42cc6effdff58fea89cddb2adae0c57 Mon Sep 17 00:00:00 2001 From: Haikel Guemar Date: Tue, 1 Sep 2020 14:43:00 +0200 Subject: [PATCH] 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 --- roles/add-sshkey/tasks/main.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/add-sshkey/tasks/main.yaml b/roles/add-sshkey/tasks/main.yaml index 74e9f2353..facb504b5 100644 --- a/roles/add-sshkey/tasks/main.yaml +++ b/roles/add-sshkey/tasks/main.yaml @@ -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"