docker compose und nach /opt/gitea verschoben
This commit is contained in:
parent
ddf9fa27f1
commit
3f400ba979
@ -12,13 +12,20 @@
|
|||||||
name: git
|
name: git
|
||||||
register: git_user
|
register: git_user
|
||||||
|
|
||||||
|
- name: Create Gitea
|
||||||
|
file:
|
||||||
|
path: "/opt/gitea"
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
- name: Create Data Directory
|
- name: Create Data Directory
|
||||||
file:
|
file:
|
||||||
path: "/opt/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 }}"
|
||||||
mode: '0755'
|
mode: 0755
|
||||||
|
|
||||||
- name: Create Config Directory
|
- name: Create Config Directory
|
||||||
file:
|
file:
|
||||||
@ -26,7 +33,7 @@
|
|||||||
state: directory
|
state: directory
|
||||||
owner: "{{ git_user.uid }}"
|
owner: "{{ git_user.uid }}"
|
||||||
group: "{{ git_user.group }}"
|
group: "{{ git_user.group }}"
|
||||||
mode: '0755'
|
mode: 0755
|
||||||
|
|
||||||
- name: Start Docker Daemon
|
- name: Start Docker Daemon
|
||||||
systemd:
|
systemd:
|
||||||
@ -38,25 +45,17 @@
|
|||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: environment.env.j2
|
src: environment.env.j2
|
||||||
dest: "/opt/gitea/environment.env"
|
dest: "/opt/gitea/environment.env"
|
||||||
owner: "{{ git_user.name }}"
|
owner: root
|
||||||
mode: '600'
|
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
|
- name: Create Gitea container
|
||||||
community.docker.docker_container:
|
community.docker.docker_compose:
|
||||||
name: gitea
|
project_src: /opt/gitea
|
||||||
image: "gitea:{{ gitea_vars['version'] }}-rootless"
|
state: present
|
||||||
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"
|
|
||||||
|
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