Marius Alwan Meyer
0f9d5f53c4
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 13s
87 lines
1.9 KiB
YAML
87 lines
1.9 KiB
YAML
# - name: Install Dependencies
|
|
# apt:
|
|
# pkg:
|
|
# - apparmor
|
|
# - docker.io
|
|
# - python3-docker
|
|
|
|
- name: Create git USER
|
|
ansible.builtin.user:
|
|
name: git
|
|
register: git_user
|
|
|
|
- name: Create Gitea
|
|
ansible.builtin.file:
|
|
path: "/opt/gitea"
|
|
state: directory
|
|
owner: root
|
|
mode: "755"
|
|
|
|
- name: Create Data Directory
|
|
ansible.builtin.file:
|
|
path: "/opt/gitea/data"
|
|
state: directory
|
|
owner: "{{ git_user.uid }}"
|
|
group: "{{ git_user.group }}"
|
|
mode: "700"
|
|
|
|
- name: Create Config Directory
|
|
ansible.builtin.file:
|
|
path: "/opt/gitea/config"
|
|
state: directory
|
|
owner: "{{ git_user.uid }}"
|
|
group: "{{ git_user.group }}"
|
|
mode: "700"
|
|
|
|
- name: Start Docker Daemon
|
|
ansible.builtin.systemd:
|
|
name: docker
|
|
enabled: true
|
|
state: started
|
|
|
|
- name: Check if environment.env will get changed
|
|
ansible.builtin.template:
|
|
src: environment.env.j2
|
|
dest: "/opt/gitea/environment.env"
|
|
owner: root
|
|
mode: "600"
|
|
register: env_diff
|
|
check_mode: true
|
|
notify:
|
|
- Backup Gitea
|
|
|
|
- name: Check if docker-compose.yaml will get changed
|
|
ansible.builtin.template:
|
|
src: docker-compose.yaml.j2
|
|
dest: /opt/gitea/docker-compose.yaml
|
|
owner: root
|
|
mode: "600"
|
|
register: docker_compose_diff
|
|
check_mode: true
|
|
notify:
|
|
- Backup Gitea
|
|
|
|
- name: Execute Handlers before changing configfiles
|
|
meta: flush_handlers
|
|
|
|
- name: Upload Environment File
|
|
ansible.builtin.template:
|
|
src: environment.env.j2
|
|
dest: "/opt/gitea/environment.env"
|
|
owner: root
|
|
mode: "600"
|
|
notify:
|
|
- Ensure Gitea is restarted
|
|
- Check Gitea HTTP Response
|
|
|
|
- name: Upload docker-compose.yaml
|
|
ansible.builtin.template:
|
|
src: docker-compose.yaml.j2
|
|
dest: /opt/gitea/docker-compose.yaml
|
|
owner: root
|
|
mode: "600"
|
|
notify:
|
|
- Output Docker Compose State
|
|
- Ensure Gitea is restarted
|
|
- Check Gitea HTTP Response
|