use common docker_compose_base_path
This commit is contained in:
parent
b00d3612e3
commit
b9bec36883
|
|
@ -1,3 +1,5 @@
|
|||
---
|
||||
docker_users:
|
||||
- "{{ ansible_user }}"
|
||||
- "{{ ansible_user }}"
|
||||
|
||||
docker_compose_projects_base_path: "/home/{{ ansible_user }}/compose_projects"
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
---
|
||||
- name: Create docker compose directory
|
||||
ansible.builtin.file:
|
||||
path: "/home/{{ ansible_user }}/compose_projects/forgejo"
|
||||
path: "{{ docker_compose_projects_base_path }}/forgejo"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
register: compose_dir
|
||||
|
||||
- name: Create data directory
|
||||
ansible.builtin.file:
|
||||
path: "/home/{{ ansible_user }}/forgejo/data"
|
||||
path: "{{ compose_dir }}/data"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
register: forgejo_data_dir
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
- name: Create DB data directory
|
||||
ansible.builtin.file:
|
||||
path: "/home/{{ ansible_user }}/forgejo/db"
|
||||
path: "{{ compose_dir }}/db"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
register: forgejo_db_dir
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
- name: Create docker compose directory
|
||||
ansible.builtin.file:
|
||||
path: "/home/{{ ansible_user }}/compose_projects/newt_compose"
|
||||
path: "{{ docker_compose_projects_base_path }}/newt_compose"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
register: compose_dir
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@ pangolin_version: "ee-latest"
|
|||
gerbil_version: "latest"
|
||||
traefik_version: "latest"
|
||||
|
||||
|
||||
pangolin_base_path: "{{ docker_compose_projects_base_path }}/pangolin"
|
||||
|
||||
|
||||
# Derived Variables
|
||||
pangolin_cors_origin: "{{ pangolin_dashboard_url }}"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,38 +1,38 @@
|
|||
---
|
||||
- name: Ensure Pangolin directory exists
|
||||
ansible.builtin.file:
|
||||
path: /home/ubuntu/pangolin
|
||||
path: "{{ pangolin_base_path }}"
|
||||
state: directory
|
||||
|
||||
- name: Ensure Pangolin config directory exists
|
||||
ansible.builtin.file:
|
||||
path: /home/ubuntu/pangolin/pangolin_config
|
||||
path: "{{ pangolin_base_path }}/pangolin_config"
|
||||
state: directory
|
||||
|
||||
- name: Template Pangolin config file
|
||||
ansible.builtin.template:
|
||||
src: pangolin_config.yml.j2
|
||||
dest: /home/ubuntu/pangolin/pangolin_config/config.yaml
|
||||
dest: "{{ pangolin_base_path }}/pangolin_config/config.yaml"
|
||||
|
||||
- name: Ensure Traefik config directory exists
|
||||
ansible.builtin.file:
|
||||
path: /home/ubuntu/pangolin/config/traefik
|
||||
path: "{{ pangolin_base_path }}/config/traefik"
|
||||
state: directory
|
||||
|
||||
- name: Template Traefik config file
|
||||
ansible.builtin.template:
|
||||
src: traefik_config.yml.j2
|
||||
dest: /home/ubuntu/pangolin/config/traefik/traefik_config.yml
|
||||
dest: "{{ pangolin_base_path }}/config/traefik/traefik_config.yml"
|
||||
|
||||
- name: Template Traefik dynamic config file
|
||||
ansible.builtin.template:
|
||||
src: dynamic_config.yml.j2
|
||||
dest: /home/ubuntu/pangolin/config/traefik/dynamic_config.yml
|
||||
dest: "{{ pangolin_base_path }}/config/traefik/dynamic_config.yml"
|
||||
|
||||
- name: Template docker-compose.yml for Pangolin
|
||||
ansible.builtin.template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: /home/ubuntu/pangolin/docker-compose.yml
|
||||
dest: "{{ pangolin_base_path }}/docker-compose.yml"
|
||||
register: pangolin_compose_template
|
||||
|
||||
- name: Check if Pangolin container is running
|
||||
|
|
@ -64,7 +64,7 @@
|
|||
|
||||
- name: Start Pangolin and Gerbil with Docker Compose (force recreate if needed)
|
||||
ansible.builtin.shell: |
|
||||
cd /home/ubuntu/pangolin
|
||||
cd {{ pangolin_base_path }}
|
||||
docker compose up -d --force-recreate
|
||||
when: pangolin_compose_needs_up
|
||||
register: docker_compose_up
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
|
||||
- name: Check Docker Compose service status
|
||||
ansible.builtin.shell: |
|
||||
cd /home/ubuntu/pangolin
|
||||
cd {{ pangolin_base_path }}
|
||||
docker compose ps
|
||||
register: docker_compose_status
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue