docker compose und nach /opt/gitea verschoben
This commit is contained in:
parent
ddf9fa27f1
commit
3f400ba979
@ -12,13 +12,20 @@
|
||||
name: git
|
||||
register: git_user
|
||||
|
||||
- name: Create Gitea
|
||||
file:
|
||||
path: "/opt/gitea"
|
||||
state: directory
|
||||
owner: root
|
||||
mode: 0755
|
||||
|
||||
- name: Create Data Directory
|
||||
file:
|
||||
path: "/opt/gitea/data"
|
||||
state: directory
|
||||
owner: "{{ git_user.uid }}"
|
||||
group: "{{ git_user.group }}"
|
||||
mode: '0755'
|
||||
mode: 0755
|
||||
|
||||
- name: Create Config Directory
|
||||
file:
|
||||
@ -26,7 +33,7 @@
|
||||
state: directory
|
||||
owner: "{{ git_user.uid }}"
|
||||
group: "{{ git_user.group }}"
|
||||
mode: '0755'
|
||||
mode: 0755
|
||||
|
||||
- name: Start Docker Daemon
|
||||
systemd:
|
||||
@ -38,25 +45,17 @@
|
||||
ansible.builtin.template:
|
||||
src: environment.env.j2
|
||||
dest: "/opt/gitea/environment.env"
|
||||
owner: "{{ git_user.name }}"
|
||||
mode: '600'
|
||||
owner: root
|
||||
mode: 0644
|
||||
|
||||
- name: Upload docker-compose.yaml
|
||||
ansible.builtin.template:
|
||||
src: docker-compose.yaml.j2
|
||||
dest: /opt/gitea/docker-compose.yaml
|
||||
owner: root
|
||||
mode: 0644
|
||||
|
||||
- name: Create Gitea container
|
||||
community.docker.docker_container:
|
||||
name: gitea
|
||||
image: "gitea:{{ gitea_vars['version'] }}-rootless"
|
||||
comparisons:
|
||||
image: strict
|
||||
volumes: strict
|
||||
env: strict
|
||||
restart_policy: unless-stopped
|
||||
volumes:
|
||||
- /opt/gitea/data:/var/lib/gitea"
|
||||
- /opt/gitea/config:/etc/gitea"
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "22:2222"
|
||||
user: "{{ git_user.uid }}:{{ git_user.group }}"
|
||||
env_file: "/opt/gitea/environment.env"
|
||||
community.docker.docker_compose:
|
||||
project_src: /opt/gitea
|
||||
state: present
|
||||
|
16
templates/docker-compose.yaml.j2
Normal file
16
templates/docker-compose.yaml.j2
Normal file
@ -0,0 +1,16 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
server:
|
||||
image: gitea/gitea:{{ gitea_vars['version'] }}-rootless
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data:/var/lib/gitea
|
||||
- ./config:/etc/gitea
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "22:2222"
|
||||
env_file: ./environment.env
|
||||
user: "{{ git_user.uid }}:{{ git_user.group }}"
|
Loading…
Reference in New Issue
Block a user