Files
ansible-role-gitea-docker/tasks/setup-compose.yaml
patrick 8fc764db49 refactor: remove geerlingguy.docker dependency
Assume Docker and Docker Compose are already installed on the target
host. This decouples the role from a specific Docker installation
method; avoiding conflicts with existing setups.
2026-04-16 07:53:47 -04:00

71 lines
1.8 KiB
YAML

---
- name: Create directory for Gitea Docker Compose stack
ansible.builtin.file:
path: "{{ gitea_home_path }}"
state: directory
mode: "0755"
- name: Create directory for data
ansible.builtin.file:
path: "{{ gitea_home_path }}/data"
state: directory
mode: "0755"
owner: "admin"
group: "admin"
notify: Deploy Docker Compose stack
- name: Create directory for config
ansible.builtin.file:
path: "{{ gitea_home_path }}/config"
state: directory
mode: "0755"
owner: "admin"
group: "admin"
notify: Deploy Docker Compose stack
- name: Create directory for logs
ansible.builtin.file:
path: "{{ gitea_home_path }}/log"
state: directory
mode: "0755"
owner: "admin"
group: "admin"
notify: Deploy Docker Compose stack
when: gitea_log_mode == 'file'
- name: Get host IP
set_fact:
gitea_host_ip: "{{ ansible_default_ipv4.address }}"
- name: Create data directories for runners
ansible.builtin.file:
path: "{{ gitea_home_path }}/{{ item.data_mount }}"
state: directory
mode: "0755"
owner: "admin"
group: "admin"
loop: "{{ gitea_runners }}"
- name: Create configuration files for each runner
ansible.builtin.template:
src: actions/config.yaml.j2
dest: "{{ gitea_home_path }}/{{ item.config_file_mount }}"
mode: "0755"
owner: "admin"
group: "admin"
loop: "{{ gitea_runners }}"
- name: Create the Compose file based on template
ansible.builtin.template:
src: docker-compose.yaml.j2
dest: "{{ gitea_home_path }}/docker-compose.yaml"
mode: "0755"
notify: Deploy Docker Compose stack
- name: Create the .env file based on template
ansible.builtin.template:
src: env.j2
dest: "{{ gitea_home_path }}/.env"
mode: "0644"
notify: Deploy Docker Compose stack