Files
infrastructure/infrastructure/ansible/prune_logic.yml
2026-01-08 19:41:23 +00:00

23 lines
777 B
YAML

---
# Pruning Logic: Entfernt Apps, die nicht mehr gewünscht sind
- name: "Prüfe auf docker-compose.yml in {{ base_deploy_path }}/{{ app_name_to_remove }}"
stat:
path: "{{ base_deploy_path }}/{{ app_name_to_remove }}/docker-compose.yml"
register: compose_file
- name: "Stoppe und entferne Container für {{ app_name_to_remove }}"
community.docker.docker_compose_v2:
project_src: "{{ base_deploy_path }}/{{ app_name_to_remove }}"
state: absent
remove_orphans: true
environment:
PATH: "/usr/bin:/usr/local/bin:/snap/bin:{{ ansible_env.PATH }}"
when: compose_file.stat.exists
- name: "Lösche App-Verzeichnis {{ base_deploy_path }}/{{ app_name_to_remove }}"
file:
path: "{{ base_deploy_path }}/{{ app_name_to_remove }}"
state: absent