First release

master
Oleg "Zmey!" Vasiliev 2023-10-07 00:11:59 +03:00
parent b8a3f62fc7
commit 6f4efc3c51
4 changed files with 63 additions and 0 deletions

26
defaults/main.yml Normal file
View File

@ -0,0 +1,26 @@
---
# See https://docs.gitea.io/en-us/config-cheat-sheet/ for additional documentation.
# Default based on https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini
gitea_config:
DEFAULT:
APP_NAME: ; Gitea: Git with a cup of tea
RUN_USER: ; git
server:
database:
DB_TYPE: mysql
HOST: 127.0.0.1:3306 ; can use socket e.g. /var/run/mysqld/mysqld.sock
NAME: gitea
USER: root
security:
INSTALL_LOCK: false
SECRET_KEY:
INTERNAL_TOKEN:
camo:
oauth2:
ENABLE: true
log:
MODE: console
LEVEL: Info
git:
service:

6
handlers/main.yml Normal file
View File

@ -0,0 +1,6 @@
---
- name: Gitea | Restart
service:
name: gitea
state: restarted

24
tasks/main.yml Normal file
View File

@ -0,0 +1,24 @@
---
- name: Gitea | Install package
package:
name: gitea
state: present
- name: Gitea | Deploy config
copy:
src: app.ini.j2
dest: /etc/gitea/app.ini
mode: 0600
owner: gitea
group: gitea
notify: Gitea | Restart
- name: Gitea | Run handlers
meta: flush_handlers
- name: Gitea | Enable and start service
service:
name: gitea
state: started
enabled: yes

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

@ -0,0 +1,7 @@
;; {{ ansible_managed }}
{% for section, settings in gitea_config.items() %}
[{{ section }}]
{% for param, value in settings.items() %}
{{ param }} = {{ value }}
{% endfor %}
{% endfor %}