homelab/roles/forgejo/tasks/main.yml

50 lines
1.2 KiB
YAML
Raw Normal View History

2024-10-01 02:05:54 +05:00
---
2024-10-21 20:46:58 +05:00
- name: Create forgejo network
become: true
community.docker.docker_network:
name: forgejo
- name: Create redis container
include_role:
name: redis
vars:
preset: cache
container_name: redis-forgejo
docker_networks:
- name: forgejo
- name: Create forgejo volume
become: true
community.docker.docker_volume:
name: forgejo
- name: Copy app.ini
become: true
ansible.builtin.template:
src: app.ini.j2
dest: /var/lib/docker/volumes/forgejo/_data/custom/conf/app.ini
owner: 1000
group: 1000
mode: '0660'
register: appini
- name: Create forgejo container
become: true
community.docker.docker_container:
name: forgejo
image: codeberg.org/forgejo/forgejo:8.0.3
env:
USER_UID: "1000"
USER_GID: "1000"
FORGEJO_WORK_DIR: "/data"
FORGEJO_CUSTOM: "/data/custom"
networks:
- name: postgresql
- name: forgejo
- name: minio
- name: haproxy
volumes:
- forgejo:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "8022:8022"
restart_policy: unless-stopped
recreate: "{{ appini.changed }}"