näher an referenz-konfiguration

This commit is contained in:
Marius Alwan Meyer 2023-02-06 11:57:58 +01:00
parent cc3a38aec9
commit ddf9fa27f1

View File

@ -1,11 +1,11 @@
--- ---
- name: Install Dependencies #- name: Install Dependencies
apt: # apt:
pkg: # pkg:
- apparmor # - apparmor
- docker.io # - docker.io
- python3-docker # - python3-docker
- name: Create git USER - name: Create git USER
ansible.builtin.user: ansible.builtin.user:
@ -14,7 +14,7 @@
- name: Create Data Directory - name: Create Data Directory
file: file:
path: "{{ git_user.home }}/gitea/data" path: "/opt/gitea/data"
state: directory state: directory
owner: "{{ git_user.uid }}" owner: "{{ git_user.uid }}"
group: "{{ git_user.group }}" group: "{{ git_user.group }}"
@ -22,7 +22,7 @@
- name: Create Config Directory - name: Create Config Directory
file: file:
path: "{{ git_user.home }}/gitea/config" path: "/opt/gitea/config"
state: directory state: directory
owner: "{{ git_user.uid }}" owner: "{{ git_user.uid }}"
group: "{{ git_user.group }}" group: "{{ git_user.group }}"
@ -37,26 +37,26 @@
- name: Upload Environment File - name: Upload Environment File
ansible.builtin.template: ansible.builtin.template:
src: environment.env.j2 src: environment.env.j2
dest: "{{ git_user.home }}/gitea/environment.env" dest: "/opt/gitea/environment.env"
owner: "{{ git_user.name }}" owner: "{{ git_user.name }}"
mode: '600' mode: '600'
- name: Create Gitea container - name: Create Gitea container
community.docker.docker_container: community.docker.docker_container:
name: gitea name: gitea
image: "gitea/gitea:{{ gitea_vars['version'] }}-rootless" image: "gitea:{{ gitea_vars['version'] }}-rootless"
comparisons: comparisons:
image: strict image: strict
volumes: strict volumes: strict
env: strict env: strict
restart_policy: unless-stopped restart_policy: unless-stopped
volumes: volumes:
- "{{ git_user.home }}/gitea/data:/var/lib/gitea" - /opt/gitea/data:/var/lib/gitea"
- "{{ git_user.home }}/gitea/config:/etc/gitea" - /opt/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:
- "3000:3000" - "3000:3000"
- "22:2222" - "22:2222"
user: "{{ git_user.uid }}:{{ git_user.group }}" user: "{{ git_user.uid }}:{{ git_user.group }}"
env_file: "{{ git_user.home }}/gitea/environment.env" env_file: "/opt/gitea/environment.env"