Add SatHub service deployment with Docker Compose and configuration
This commit is contained in:
42
ansible/tasks/servers/services/sathub/sathub.yml
Normal file
42
ansible/tasks/servers/services/sathub/sathub.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
- 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"
|
||||
|
||||
- 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 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
|
||||
|
||||
- name: Start SatHub service
|
||||
ansible.builtin.command: docker compose -f "{{ sathub_service_dir }}/docker-compose.yml" up -d
|
||||
when: sathub_compose.changed
|
||||
tags:
|
||||
- services
|
||||
- sathub
|
||||
Reference in New Issue
Block a user