Use lineinfile

This commit is contained in:
Luke Murphy 2020-03-23 20:56:32 +01:00
parent 795a1afb6e
commit 75663a7025
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 6 additions and 5 deletions

View File

@ -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