2022-05-31 04:36:55 +00:00
|
|
|
---
|
2023-01-22 00:25:02 +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
|
|
|
|
2023-02-02 05:30:14 +00:00
|
|
|
- name: Grab package facts
|
|
|
|
package_facts:
|
|
|
|
manager: auto
|
|
|
|
|
2023-01-22 00:25:02 +00:00
|
|
|
- name: Install Gitea
|
2023-01-19 21:11:22 +00:00
|
|
|
block:
|
2023-01-22 00:25:02 +00:00
|
|
|
- name: Add Gitea key, repository && install
|
|
|
|
block:
|
|
|
|
- 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
|
|
|
|
when: gitea_key.stat.exists == false or gitea_key.stat.mode != "0644"
|
2023-01-20 00:03:49 +00:00
|
|
|
|
2023-01-22 00:25:02 +00:00
|
|
|
- name: Add Gitea repository
|
|
|
|
apt_repository:
|
|
|
|
filename: morph027-gitea
|
|
|
|
repo: deb https://packaging.gitlab.io/gitea gitea main
|
|
|
|
|
|
|
|
- name: Add Gitea package
|
|
|
|
package:
|
|
|
|
name: gitea
|
|
|
|
when: "'gitea' not in ansible_facts.packages"
|
|
|
|
|
|
|
|
- name: Configure Gitea
|
|
|
|
template:
|
|
|
|
src: templates/app.ini
|
|
|
|
dest: /etc/gitea/app.ini
|
|
|
|
owner: gitea
|
|
|
|
force: no # we don't want to kill our existing config D:
|
|
|
|
|
|
|
|
- name: Reload Gitea
|
|
|
|
systemd:
|
|
|
|
name: gitea
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
2023-02-02 05:30:14 +00:00
|
|
|
|
|
|
|
- name: Backup db
|
|
|
|
include_tasks: backup.yml
|
|
|
|
tags: ['never', 'backup']
|
2023-02-02 22:04:44 +00:00
|
|
|
tags: ['gitea', 'backup']
|