move data to /var/lib/gitea
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 25s

This commit is contained in:
Marius Meyer 2024-06-03 14:02:44 +02:00
parent 306d2eebbe
commit c28214c517
3 changed files with 10 additions and 8 deletions

View File

@ -18,7 +18,7 @@
- name: Backup Gitea directory - name: Backup Gitea directory
community.general.archive: community.general.archive:
path: /opt/gitea/ path: /var/lib/gitea/
dest: "/var/backups/gitea-{{ gitea.hostname }}.{{ gitea.domain }}@{{ lookup('pipe', 'date -u +%Y-%m-%dT%H:%M:%SZ') }}.tar.gz" dest: "/var/backups/gitea-{{ gitea.hostname }}.{{ gitea.domain }}@{{ lookup('pipe', 'date -u +%Y-%m-%dT%H:%M:%SZ') }}.tar.gz"
force_archive: true force_archive: true
format: gz format: gz

View File

@ -10,16 +10,18 @@
name: git name: git
register: git_user register: git_user
- name: Ensure Gitea directory exists - name: Ensure Gitea directories exist
ansible.builtin.file: ansible.builtin.file:
path: "/opt/gitea" path: "{{ item }}"
state: directory state: directory
owner: root owner: root
mode: "755" mode: "755"
recurse: yes
with_items: ["/opt/gitea", "/var/lib/gitea"]
- name: Ensure data directory exists - name: Ensure data directory exists
ansible.builtin.file: ansible.builtin.file:
path: "/opt/gitea/data" path: "/var/lib/gitea/data"
state: directory state: directory
owner: "{{ git_user.uid }}" owner: "{{ git_user.uid }}"
group: "{{ git_user.group }}" group: "{{ git_user.group }}"
@ -27,7 +29,7 @@
- name: Ensure config directory exists - name: Ensure config directory exists
ansible.builtin.file: ansible.builtin.file:
path: "/opt/gitea/config" path: "/var/lib/gitea/config"
state: directory state: directory
owner: "{{ git_user.uid }}" owner: "{{ git_user.uid }}"
group: "{{ git_user.group }}" group: "{{ git_user.group }}"

View File

@ -15,8 +15,8 @@ services:
image: gitea/gitea:{{ gitea_vars['version'] }}-rootless image: gitea/gitea:{{ gitea_vars['version'] }}-rootless
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- ./data:/var/lib/gitea - /var/lib/gitea/data:/var/lib/gitea
- ./config:/etc/gitea - /var/lib/gitea/config:/etc/gitea
- /etc/timezone:/etc/timezone:ro - /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
ports: ports:
@ -40,6 +40,6 @@ services:
networks: networks:
- gitea - gitea
volumes: volumes:
- ./mysql:/var/lib/mysql - /var/lib/gitea/mysql:/var/lib/mysql
cap_add: cap_add:
- SYS_NICE - SYS_NICE