diff --git a/ansible/pre-deploy.yml b/ansible/pre-deploy.yml index 83a1c02..b0bb22d 100644 --- a/ansible/pre-deploy.yml +++ b/ansible/pre-deploy.yml @@ -8,17 +8,23 @@ extensions: - yml - - name: Retrieve git user ssh public key - set_fact: - git_ssh_pub_key: "{{ lookup('file', '/home/git/.ssh/id_rsa.pub') }}" - git_auth_keys: "{{ lookup('file', '/var/lib/gitea/git/.ssh/authorized_keys') }}" + - name: Slurp the git user ssh public key + slurp: + src: /home/git/.ssh/id_rsa.pub + register: git_id_rsa + become: true + + - name: Slurp the git user ssh authorized_keys + slurp: + src: /var/lib/gitea/git/.ssh/authorized_keys + register: git_auth_keys become: true - name: TEST TEST TEST lineinfile: path: /var/lib/gitea/git/.ssh/authorized_keys - regexp: "^{{ git_ssh_pub_key }}" - line: "{{ git_ssh_pub_key }}{{ git_auth_keys }}" + regexp: "^{{ git_id_rsa['content'] }}" + line: "{{ git_id_rsa['content'] }}{{ git_auth_keys['content'] }}" state: present create: true become: true