Try slurp
This commit is contained in:
parent
53dc7dd107
commit
0dba3a883a
@ -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
|
||||
|
Reference in New Issue
Block a user