Update gitea so that it uses podman's auto update policy

Plus some a bit of housekeeping
This commit is contained in:
Matt Spencer committed 2026-10-19 14:19:10 +01:00
1 parent 9531b42cdb
commit 19402b8bce
4 files changed
+196 -45

No files matched your search

+39 -20
View File
@@ -80,26 +80,45 @@
name: webservices
state: present
- name: Start gitea
containers.podman.podman_container:
name: gitea
image: docker.io/gitea/gitea:latest
restart_policy: always
network: webservices
label:
io.containers.autoupdate: registry
env:
USER_UID: "{{ gitea_uid }}"
USER_GID: "{{ gitea_gid }}"
TZ: Europe/London
volumes:
- /srv/gitea/data:/data:z
# No SELinux context modification for this volume (no :z)
- /mnt/gitea_repos:/data/git/repositories
ports:
- "3002:3000"
- "2222:22"
state: started
- name: Create Podman systemd directory for user
ansible.builtin.file:
path: "/home/{{ username }}/.config/containers/systemd"
state: directory
mode: '0755'
owner: "{{ username }}"
group: "{{ username }}"
- name: Deploy Gitea Quadlet configuration
ansible.builtin.copy:
dest: "/home/{{ username }}/.config/containers/systemd/gitea.container"
owner: "{{ username }}"
mode: '0644'
content: |
[Container]
ContainerName=gitea
Image=docker.io/gitea/gitea:latest
Network=webservices
AutoUpdate=registry
Environment=USER_UID={{ gitea_uid }} USER_GID={{ gitea_gid }} TZ=Europe/London
Volume=/srv/gitea/data:/data:z
Volume=/mnt/gitea_repos:/data/git/repositories
PublishPort=3002:3000
PublishPort=2222:22
[Service]
Restart=always
[Install]
WantedBy=default.target
register: gitea_quadlet
- name: Reload user systemd and ensure gitea is started
ansible.builtin.systemd:
daemon_reload: true
name: gitea.service
enabled: true
state: "{{ gitea_quadlet.changed | ternary('restarted', 'started') }}"
scope: user
- name: Enable lingering for {{ username }}
become: true