gitea add ssh key in setup

This commit is contained in:
2024-08-17 13:49:36 +02:00
parent 459d255471
commit 4d83e9fceb
4 changed files with 63 additions and 0 deletions
@@ -0,0 +1 @@
user_home: "{{ lookup('ansible.builtin.env','HOME') }}"
@@ -0,0 +1,19 @@
ssh_public_key_paths:
- /Users/gabrielradureau/.ssh/id_ed25519_arcodange.pub
- "{{ user_home }}/.ssh/id_ed25519.pub"
- "{{ user_home }}/.ssh/id_rsa.pub"
ssh_public_key_path: >-
{{ (
lookup('ansible.builtin.first_found', files=ssh_public_key_paths, errors='ignore')
)
}}
ssh_public_key_found: "{{ ssh_public_key_path > '' }}"
ssh_public_key_full_content: >-
{{
'key_type b64key key_name' if not ssh_public_key_found
else
lookup('ansible.builtin.file', ssh_public_key_path)
}}
ssh_public_key: "{{ ssh_public_key_full_content.split()[1] }}"
ssh_key_title: "{{ ssh_public_key_full_content.split()[-1] }}"
ssh_key_algorithm: "{{ ssh_public_key_full_content.split()[0] }}"
@@ -40,6 +40,8 @@ gitea:
GITEA__mailer__SMTP_ADDR: smtp.orange.fr
GITEA__mailer__SMTP_PORT: 465
GITEA__mailer__PASSWD: '{{ gitea_vault.GITEA__mailer__PASSWD }}'
GITEA__server__SSH_PORT: 2222
GITEA__server__SSH_LISTEN_PORT: 22
networks:
- gitea
ports: