minor: Add Gitea to SCM role

This commit is contained in:
2026-04-08 18:05:00 -03:00
commit 8417362549
14 changed files with 572 additions and 0 deletions

14
templates/app.ini.j2 Normal file
View File

@@ -0,0 +1,14 @@
; {{ ansible_managed }}
; SPDX-License-Identifier: GPL-3.0-only
{% if 'DEFAULT' in gitea_app_ini %}
{% for key, value in gitea_app_ini['DEFAULT'].items() %}
{{ key }} = {{ value }}
{% endfor %}
{% endif %}
{% for section, entries in gitea_app_ini.items() if section != 'DEFAULT' %}
[{{ section }}]
{% for key, value in entries.items() %}
{{ key }} = {{ value }}
{% endfor %}
{% endfor %}

View File

@@ -0,0 +1,24 @@
# {{ ansible_managed }}
# SPDX-License-Identifier: GPL-3.0-only
[Unit]
Description=Gitea (Git with a cup of tea)
After=network-online.target
Wants=network-online.target
AssertFileIsExecutable={{ gitea_opt }}/{{ gitea_name }}
AssertPathExists={{ gitea_etc }}/app.ini
[Service]
RestartSec=2s
Type=simple
User={{ gitea_user }}
Group={{ gitea_group }}
WorkingDirectory={{ gitea_home }}
ExecStart={{ gitea_opt }}/{{ gitea_name }} web --config {{ gitea_etc }}/app.ini
Restart=always
Environment=USER={{ gitea_user }} HOME={{ gitea_user_home }} GITEA_WORK_DIR={{ gitea_home }}
# Uncomment to bind ports < 1024 without running as root
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
#AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target