Move ssh and git tasks into dedicated role "ssh"
This commit is contained in:
18
roles/ssh/tasks/main.yml
Normal file
18
roles/ssh/tasks/main.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
- name: Ensure ssh keypair
|
||||
openssh_keypair:
|
||||
path: "{{ lookup('env', 'HOME') }}/.ssh/id_ed25519"
|
||||
type: ed25519
|
||||
regenerate: full_idempotence
|
||||
|
||||
- name: Ensure ssh key on github
|
||||
github_key:
|
||||
name: "{{ lookup('env', 'USER') }}@{{ hostname }}"
|
||||
token: "{{ github_token }}"
|
||||
pubkey: "{{ lookup('file', lookup('env', 'HOME') ~ '/.ssh/id_ed25519.pub') }}"
|
||||
|
||||
- name: Ensure ssh key on gitea
|
||||
github_key:
|
||||
name: "{{ lookup('env', 'USER') }}@{{ hostname }}"
|
||||
token: "{{ gitea_token }}"
|
||||
pubkey: "{{ lookup('file', lookup('env', 'HOME') ~ '/.ssh/id_ed25519.pub') }}"
|
||||
api_url: "{{ gitea_api_url }}"
|
||||
Reference in New Issue
Block a user