Add Template to deploy forgejo.

This template allows deploying a forgejo en either Scaleway or Hetzner
(untested) without much knowledge about them.
It DOES require knowledge about Terragrunt and ansible. A wizard of
sorts is provided but it will not guarantee success without some
knowledge about the underlying technology.
This commit is contained in:
Horacio Duran 2026-01-09 16:07:44 +01:00
parent a9f546f92a
commit 822e42dbb8
48 changed files with 6846 additions and 2 deletions

View file

@ -0,0 +1,81 @@
---
# Handlers for Forgejo role
- name: Restart Docker
ansible.builtin.systemd:
name: docker
state: restarted
daemon_reload: yes
become: yes
- name: Restart Forgejo
community.docker.docker_compose_v2:
project_src: "{{ forgejo_base_path }}"
state: restarted
become: yes
- name: Reload Forgejo
community.docker.docker_compose_v2:
project_src: "{{ forgejo_base_path }}"
reloaded: yes
become: yes
- name: Restart PostgreSQL
ansible.builtin.systemd:
name: postgresql
state: restarted
become: yes
when: forgejo_db_type == 'postgres'
- name: Restart Redis
ansible.builtin.systemd:
name: redis-server
state: restarted
become: yes
when: forgejo_use_redis | bool
- name: Reload Caddy
ansible.builtin.systemd:
name: caddy
state: reloaded
become: yes
- name: Restart Caddy
ansible.builtin.systemd:
name: caddy
state: restarted
become: yes
- name: Reload Systemd
ansible.builtin.systemd:
daemon_reload: yes
become: yes
- name: Restart UFW
ansible.builtin.systemd:
name: ufw
state: restarted
become: yes
- name: Restart sshd
ansible.builtin.systemd:
name: sshd
state: restarted
become: yes
- name: Renew SSL Certificate
ansible.builtin.debug:
msg: "Caddy handles certificate renewal automatically - no manual action needed"
when: forgejo_enable_letsencrypt | bool
- name: Restart Prometheus
community.docker.docker_compose_v2:
project_src: "{{ forgejo_base_path }}"
files:
- docker-compose.yml
- docker-compose.monitoring.yml
services:
- prometheus
state: restarted
become: yes
when: forgejo_enable_prometheus | bool