diff --git a/ansible/post-deploy.yml b/ansible/post-deploy.yml index fa804c5..01934dd 100644 --- a/ansible/post-deploy.yml +++ b/ansible/post-deploy.yml @@ -66,9 +66,11 @@ - name: Set authorized_keys file for git user lineinfile: path: /var/lib/gitea/git/.ssh/authorized_keys - line: "{{ lookup('file', '/home/git/.ssh/id_rsa.pub') }}" + regexp: "^{{ lookup('file', '/home/git/.ssh/id_rsa.pub') }}" + line: "{{ lookup('file', '/home/git/.ssh/id_rsa.pub') }}{{ lookup('file', '/var/lib/gitea/git/.ssh/authorized_keys') }}" state: present insertbefore: BOF + create: true become: true - name: Symlink the authorized keys configuration