ansible/playbooks/stop_containers.yaml

20 lines
819 B
YAML
Raw Normal View History

2023-12-06 16:51:42 +01:00
---
2024-11-15 13:43:32 +01:00
- name: Add elements to a list
set_fact:
docker_containers: "{{ docker_containers | default([]) + [item] }}"
loop:
2024-11-15 13:45:26 +01:00
- semaphore-db-1
- semaphore-app-1
2024-11-15 13:46:52 +01:00
when: '"semaphore" in selected_containers'
2024-11-15 13:45:26 +01:00
2024-11-15 13:48:52 +01:00
# kestra-kestra-1 kestra-postgres-1 authentik-postgresql-1 authentik-worker-1 authentik-server-1 authentik-redis-1 gitlab semaphore-db-1 semaphore-app-1 nginx-app-1 heimdall mailu2-admin-1 mailu2-antispam-1 mailu2-antivirus-1 mailu2-fetchmail-1 mailu2-front-1 mailu2-imap-1 mailu2-oletools-1 mailu2-redis-1 mailu2-resolver-1 mailu2-smtp-1 mailu2-webdav-1 mailu2-webmail-1 HomeAssistant mosquitto-mosquitto-1 webhub-web-1"
2024-11-15 13:43:32 +01:00
- debug:
msg: "{{ docker_containers }}"
2023-12-06 16:51:42 +01:00
- name: Stop mailu containers
2024-11-15 13:48:52 +01:00
command: "docker stop {{ docker_containers|split(' ') }}"
2023-12-06 16:51:42 +01:00
become: true
2024-11-15 13:43:32 +01:00
ignore_errors: true