48 lines
1.5 KiB
YAML
48 lines
1.5 KiB
YAML
---
|
|
- name: Deploy OpenVox Docker Compose Project
|
|
hosts: "{{ target_host | default('localhost') }}"
|
|
become: true
|
|
vars:
|
|
project_dir_name: "openvox"
|
|
# ANNAHME: Das Playbook wird aus dem übergeordneten Verzeichnis von 'openvox' ausgeführt.
|
|
# Passen Sie ggf. den Pfad an.
|
|
project_local_path: "{{ playbook_dir }}/{{ project_dir_name }}"
|
|
project_remote_path: "/opt/{{ project_dir_name }}"
|
|
|
|
tasks:
|
|
- name: "Stellt sicher, dass das Projektverzeichnis auf dem Zielhost existiert"
|
|
ansible.builtin.file:
|
|
path: "{{ project_remote_path }}"
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: "Kopiert die Projektdateien auf den Zielhost"
|
|
ansible.builtin.copy:
|
|
src: "{{ project_local_path }}/"
|
|
dest: "{{ project_remote_path }}/"
|
|
|
|
- name: "Stellt sicher, dass das ca_data Verzeichnis existiert"
|
|
ansible.builtin.file:
|
|
path: "{{ project_remote_path }}/ca_data"
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: "Setzt die Berechtigungen für das ca_data Verzeichnis"
|
|
ansible.builtin.file:
|
|
path: "{{ project_remote_path }}/ca_data"
|
|
owner: '999'
|
|
group: '999'
|
|
recurse: true
|
|
|
|
- name: "Startet die Docker Compose Services"
|
|
community.docker.docker_compose_v2:
|
|
project_src: "{{ project_remote_path }}"
|
|
state: present # 'present' entspricht 'up -d'
|
|
register: compose_output
|
|
|
|
- name: "Zeigt den Output von Docker Compose an"
|
|
ansible.builtin.debug:
|
|
var: compose_output
|
|
|
|
|