2022-10-14 15:08:14 +02:00
|
|
|
|
|
|
|
---
|
2023-02-06 11:57:58 +01:00
|
|
|
#- name: Install Dependencies
|
|
|
|
# apt:
|
|
|
|
# pkg:
|
|
|
|
# - apparmor
|
|
|
|
# - docker.io
|
|
|
|
# - python3-docker
|
2022-10-14 15:08:14 +02:00
|
|
|
|
2022-11-08 11:46:39 +01:00
|
|
|
- name: Create git USER
|
|
|
|
ansible.builtin.user:
|
|
|
|
name: git
|
|
|
|
register: git_user
|
|
|
|
|
2023-02-06 12:50:22 +01:00
|
|
|
- name: Create Gitea
|
|
|
|
file:
|
|
|
|
path: "/opt/gitea"
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
mode: 0755
|
|
|
|
|
2022-10-14 15:08:14 +02:00
|
|
|
- name: Create Data Directory
|
|
|
|
file:
|
2023-02-06 11:57:58 +01:00
|
|
|
path: "/opt/gitea/data"
|
2022-10-14 15:08:14 +02:00
|
|
|
state: directory
|
2022-11-08 11:46:39 +01:00
|
|
|
owner: "{{ git_user.uid }}"
|
|
|
|
group: "{{ git_user.group }}"
|
2023-02-06 12:50:22 +01:00
|
|
|
mode: 0755
|
2022-10-14 15:08:14 +02:00
|
|
|
|
|
|
|
- name: Create Config Directory
|
|
|
|
file:
|
2023-02-06 11:57:58 +01:00
|
|
|
path: "/opt/gitea/config"
|
2022-10-14 15:08:14 +02:00
|
|
|
state: directory
|
2022-11-08 11:46:39 +01:00
|
|
|
owner: "{{ git_user.uid }}"
|
|
|
|
group: "{{ git_user.group }}"
|
2023-02-06 12:50:22 +01:00
|
|
|
mode: 0755
|
2022-10-14 15:08:14 +02:00
|
|
|
|
2023-03-11 20:08:57 +01:00
|
|
|
- name: Create Logging Directory
|
|
|
|
file:
|
|
|
|
path: "/opt/gitea/log"
|
|
|
|
state: directory
|
|
|
|
owner: "{{ git_user.uid }}"
|
|
|
|
group: "{{ git_user.group }}"
|
|
|
|
mode: 0755
|
|
|
|
|
2022-10-14 15:08:14 +02:00
|
|
|
- name: Start Docker Daemon
|
|
|
|
systemd:
|
|
|
|
name: docker
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
|
|
|
|
2022-11-11 17:52:53 +01:00
|
|
|
- name: Upload Environment File
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: environment.env.j2
|
2023-02-06 11:57:58 +01:00
|
|
|
dest: "/opt/gitea/environment.env"
|
2023-02-06 12:50:22 +01:00
|
|
|
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
|
2022-11-11 17:52:53 +01:00
|
|
|
|
2022-10-14 15:08:14 +02:00
|
|
|
- name: Create Gitea container
|
2023-02-06 12:50:22 +01:00
|
|
|
community.docker.docker_compose:
|
|
|
|
project_src: /opt/gitea
|
|
|
|
state: present
|
2023-03-03 12:40:31 +01:00
|
|
|
recreate: smart
|