---
- name: Create gitea-app container
  containers.podman.podman_container:
    name: gitea-app
    state: quadlet
    network: gitea-net
    image: docker.io/gitea/gitea:latest-rootless
    tty: true
    ports:
      - "3000:3000"
      - "2222:2222"
    volume:
      - /home/seandersont/gitea/data:/var/lib/gitea
      - /home/seandersont/gitea/config:/etc/gitea
        #      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    env:
      USER_UID: 1000
      USER_GID: 1000
      GITEA__database__DB_TYPE: "postgres"
      GITEA__database__HOST: "gitea-pgdb:5432"
      GITEA__database__NAME: "gitea"
      GITEA__database__USER: "gitea"
      GITEA__database__PASSWD: "MicrophoneExtensionBalb0a"
    quadlet_options:
      - "AutoUpdate=registry"
      - |
        [Install]
        WantedBy=default.target

- name: start gitea-app systemd unit
  ansible.builtin.systemd:
    name: gitea-app
    daemon_reload: true
    state: started
    enabled: true
