From 75663a702576cebaf05f14ca696869fa5b9bb257 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Mon, 23 Mar 2020 20:56:32 +0100 Subject: [PATCH] Use lineinfile --- ansible/post-deploy.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ansible/post-deploy.yml b/ansible/post-deploy.yml index 23d9165..573f9af 100644 --- a/ansible/post-deploy.yml +++ b/ansible/post-deploy.yml @@ -64,12 +64,13 @@ become: true - name: Set authorized keys for git user - authorized_key: - user: git - state: present - key: "{{ lookup('file', '/home/git/.ssh/id_rsa.pub') }}" + lineinfile: path: /var/lib/gitea/git/.ssh/authorized_keys - manage_dir: false + line: "{{ lookup('file', '/home/git/.ssh/id_rsa.pub') }}" + owner: git + group: git + state: present + with_file: become: true - name: Symlink the authorized keys configuration