Use command module instead
This commit is contained in:
parent
dbdfda3c48
commit
f9b4ce7a46
@ -74,11 +74,9 @@
|
|||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Check if the public key is already in place
|
- name: Check if the public key is already in place
|
||||||
lineinfile:
|
command: 'grep -Fxq "{{ git_id_rsa_pub.stdout}}" /var/lib/gitea/git/.ssh/authorized_keys'
|
||||||
path: /var/lib/gitea/git/.ssh/authorized_keys
|
check_mode: false
|
||||||
regexp: "^{{ git_id_rsa_pub.stdout }}"
|
ignore_errors: true
|
||||||
state: absent
|
|
||||||
check_mode: true
|
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: git_id_rsa_pub_check
|
register: git_id_rsa_pub_check
|
||||||
|
|
||||||
@ -94,7 +92,7 @@
|
|||||||
backup: true
|
backup: true
|
||||||
marker: "# ansible inserted git <-> gitea public key"
|
marker: "# ansible inserted git <-> gitea public key"
|
||||||
become: true
|
become: true
|
||||||
when: git_id_rsa_pub_check.found
|
when: git_id_rsa_pub_check.rc == 0
|
||||||
|
|
||||||
- name: Symlink the gitea authorized keys configuration to the host git user
|
- name: Symlink the gitea authorized keys configuration to the host git user
|
||||||
file:
|
file:
|
||||||
|
Reference in New Issue
Block a user