From c72eaafe4788e67feb3e7d3b2a7add9c165e6200 Mon Sep 17 00:00:00 2001 From: Alexis Pentori Date: Thu, 1 Jun 2023 14:50:52 +0200 Subject: [PATCH] Changing writing of ssh priv key for EOF at the end of the file Signed-off-by: Alexis Pentori --- tasks/user.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasks/user.yml b/tasks/user.yml index e672dff..0392167 100644 --- a/tasks/user.yml +++ b/tasks/user.yml @@ -22,10 +22,12 @@ mode: 0750 when: github_webhook_ssh_key is defined +# The field content need the literral block style ( `|` ) to keep the EOF at the end and ensure the validity of the key. - name: Create SSH private key copy: dest: '{{ github_webhook_home }}/.ssh/id_rsa' - content: '{{ github_webhook_ssh_key }}' + content: | + {{ github_webhook_ssh_key }} owner: '{{ github_webhook_service_user }}' group: '{{ github_webhook_service_user }}' mode: 0400