migrate forgejo

This commit is contained in:
TÁNCZOS Vilmos Zsombor 2025-05-05 02:13:27 +02:00
parent 9eb399876e
commit 589f45b786
7 changed files with 73 additions and 35 deletions

View file

@ -0,0 +1,5 @@
service_name: forgejo
docker_image: codeberg.org/forgejo/forgejo
docker_image_version: 11
data_directory: "{{ service_root }}/data"
public_ssh_port: 222

View file

@ -0,0 +1,31 @@
- name: Deploy Forgejo
ansible.builtin.import_role:
name: compose-service
vars:
docker_volumes:
- '{{ data_directory }}:/data'
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
docker_env:
USER_UID: '{{ getent_passwd[service_user].1 }}'
USER_GID: '{{ getent_passwd[service_user].2 }}'
FORGEJO__server__SSH_PORT: '{{ public_ssh_port }}'
FORGEJO__openid__ENABLE_OPENID_SIGNIN: false
FORGEJO__openid__ENABLE_OPENID_SIGNUP: false
docker_ports:
- "{{ public_ssh_port }}:22"
use_docker_user: false
- name: Ensure data directory exists
ansible.builtin.file:
path: '{{ data_directory }}'
state: directory
owner: '{{ service_user }}'
group: '{{ service_user }}'
mode: '700'
- name: Deploy Caddyfile for Forgejo
vars:
docker_http_port: 3000
ansible.builtin.import_tasks: ../../common/tasks/create_caddyfile_for_compose-service.yml