ansible/playbooks/stop_containers.yaml

105 lines
2.8 KiB
YAML
Raw Permalink 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:57:18 +01:00
- name: Add elements to a list
set_fact:
docker_containers: "{{ docker_containers | default([]) + [item] }}"
loop:
- authentik-postgresql-1
- authentik-worker-1
- authentik-server-1
- authentik-redis-1
when: '"authentik" in selected_containers'
- name: Add elements to a list
set_fact:
docker_containers: "{{ docker_containers | default([]) + [item] }}"
loop:
- kestra-kestra-1
- kestra-postgres-1
when: '"kestra" in selected_containers'
- name: Add elements to a list
set_fact:
docker_containers: "{{ docker_containers | default([]) + [item] }}"
loop:
- gitlab
when: '"gitlab" in selected_containers'
- name: Add elements to a list
set_fact:
docker_containers: "{{ docker_containers | default([]) + [item] }}"
loop:
- nginx-app-1
when: '"nginx" in selected_containers'
- name: Add elements to a list
set_fact:
docker_containers: "{{ docker_containers | default([]) + [item] }}"
loop:
- heimdall
when: '"heimdall" in selected_containers'
- name: Add elements to a list
set_fact:
docker_containers: "{{ docker_containers | default([]) + [item] }}"
loop:
- mailu3-admin-1
- mailu3-antispam-1
- mailu3-antivirus-1
- mailu3-fetchmail-1
- mailu3-front-1
- mailu3-imap-1
- mailu3-oletools-1
- mailu3-redis-1
- mailu3-resolver-1
- mailu3-smtp-1
- mailu3-webdav-1
- mailu3-webmail-1
2024-11-15 14:12:07 +01:00
- mailu3-fts_attachments-1
2024-11-15 13:57:18 +01:00
when: '"mailu3" in selected_containers'
2024-11-15 15:41:25 +01:00
2024-11-15 13:57:18 +01:00
- name: Add elements to a list
set_fact:
docker_containers: "{{ docker_containers | default([]) + [item] }}"
loop:
- HomeAssistant
when: '"homeassistant" in selected_containers'
2024-11-15 15:41:25 +01:00
2024-11-15 13:57:18 +01:00
- name: Add elements to a list
set_fact:
docker_containers: "{{ docker_containers | default([]) + [item] }}"
loop:
- webhub-web-1"
when: '"webhub" in selected_containers'
2024-11-15 15:41:25 +01:00
2024-11-15 13:57:18 +01:00
- name: Add elements to a list
set_fact:
docker_containers: "{{ docker_containers | default([]) + [item] }}"
loop:
2024-11-15 15:41:25 +01:00
- mosquitto-mosquitto-1
2024-11-15 13:57:18 +01:00
when: '"mosquitto" in selected_containers'
2024-11-15 15:39:07 +01:00
2024-11-15 17:05:50 +01:00
- name: Add elements to a list
set_fact:
docker_containers: "{{ docker_containers | default([]) + [item] }}"
loop:
- webhub-web-1
when: '"webhub" in selected_containers'
2024-11-15 17:19:57 +01:00
- name: Add elements to a list
set_fact:
docker_containers: "{{ docker_containers | default([]) + [item] }}"
loop:
- pihole
when: '"pihole" in selected_containers'
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:50:06 +01:00
command: "docker stop {{ docker_containers|join(' ') }}"
2023-12-06 16:51:42 +01:00
become: true
2024-11-15 13:43:32 +01:00
ignore_errors: true