51 lines
1.6 KiB
YAML
51 lines
1.6 KiB
YAML
---
|
|
- name: Deploy SatHub service
|
|
block:
|
|
- name: Set SatHub directories
|
|
ansible.builtin.set_fact:
|
|
sathub_service_dir: "{{ ansible_env.HOME }}/.services/sathub"
|
|
sathub_data_dir: "/mnt/services/sathub"
|
|
|
|
- name: Set SatHub frontend configuration
|
|
ansible.builtin.set_fact:
|
|
frontend_api_base_url: "https://api.sathub.de"
|
|
frontend_allowed_hosts: "sathub.de,sathub.nl"
|
|
cors_allowed_origins: "https://sathub.nl,https://api.sathub.de,https://obj.sathub.de"
|
|
|
|
- name: Create SatHub directory
|
|
ansible.builtin.file:
|
|
path: "{{ sathub_service_dir }}"
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: Create SatHub data directory
|
|
ansible.builtin.file:
|
|
path: "{{ sathub_data_dir }}"
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: Deploy SatHub .env
|
|
ansible.builtin.template:
|
|
src: .env.j2
|
|
dest: "{{ sathub_service_dir }}/.env"
|
|
mode: "0644"
|
|
register: sathub_env
|
|
|
|
- name: Deploy SatHub docker-compose.yml
|
|
ansible.builtin.template:
|
|
src: docker-compose.yml.j2
|
|
dest: "{{ sathub_service_dir }}/docker-compose.yml"
|
|
mode: "0644"
|
|
register: sathub_compose
|
|
|
|
- name: Stop SatHub service
|
|
ansible.builtin.command: docker compose -f "{{ sathub_service_dir }}/docker-compose.yml" down --remove-orphans
|
|
when: sathub_compose.changed or sathub_env.changed
|
|
|
|
- name: Start SatHub service
|
|
ansible.builtin.command: docker compose -f "{{ sathub_service_dir }}/docker-compose.yml" up -d
|
|
when: sathub_compose.changed or sathub_env.changed
|
|
tags:
|
|
- services
|
|
- sathub
|