2022-05-31 04:36:55 +00:00
|
|
|
---
|
2023-01-20 00:03:49 +00:00
|
|
|
- name: Check if Gitea is installed
|
|
|
|
shell: gitea --version
|
|
|
|
register: validate_gitea
|
2023-01-20 02:50:30 +00:00
|
|
|
changed_when: no
|
2023-01-19 21:11:22 +00:00
|
|
|
|
|
|
|
- name: Add Gitea key && repository
|
|
|
|
block:
|
2023-01-20 00:03:49 +00:00
|
|
|
- name: Check for Gitea gpg key
|
|
|
|
stat:
|
|
|
|
path: /etc/apt/trusted.gpg.d/morph027-gitea.gpg
|
|
|
|
register: gitea_key
|
|
|
|
|
2023-01-19 21:11:22 +00:00
|
|
|
- name: Import Gitea key
|
|
|
|
shell: curl -s https://packaging.gitlab.io/gitea/gpg.key | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/morph027-gitea.gpg --import && sudo chmod 644 /etc/apt/trusted.gpg.d/morph027-gitea.gpg
|
2023-01-20 00:03:49 +00:00
|
|
|
when: gitea_key.stat.exists == false or gitea_key.stat.mode != "0644"
|
2023-01-19 21:11:22 +00:00
|
|
|
|
|
|
|
- name: Add Gitea repository
|
|
|
|
apt_repository:
|
|
|
|
filename: morph027-gitea
|
|
|
|
repo: deb https://packaging.gitlab.io/gitea gitea main
|
2023-01-20 00:03:49 +00:00
|
|
|
when: '"not found" in validate_gitea.stdout'
|
2023-01-19 21:11:22 +00:00
|
|
|
|
|
|
|
- name: Install Gitea
|
|
|
|
package:
|
|
|
|
name:
|
|
|
|
- gitea
|
|
|
|
|
2022-05-30 15:46:36 +00:00
|
|
|
- name: Configure Gitea
|
|
|
|
template:
|
2023-01-20 00:03:49 +00:00
|
|
|
src: templates/app.ini
|
2022-05-30 15:46:36 +00:00
|
|
|
dest: /etc/gitea/app.ini
|
2022-05-31 00:32:24 +00:00
|
|
|
owner: gitea
|
2022-05-31 18:48:01 +00:00
|
|
|
force: no # we don't want to kill our existing config D:
|
2022-05-30 15:46:36 +00:00
|
|
|
|
|
|
|
- name: Reload Gitea
|
|
|
|
systemd:
|
|
|
|
name: gitea
|
|
|
|
enabled: yes
|
2022-08-02 18:32:19 +00:00
|
|
|
state: started
|