refactor(roles/dokploy): refactored dokploy role
This commit is contained in:
@@ -9,14 +9,22 @@
|
||||
- dokploy
|
||||
- dokploy-redis
|
||||
- dokploy-postgres
|
||||
ignore_errors: true
|
||||
register: _dokploy_remove_services
|
||||
failed_when:
|
||||
- _dokploy_remove_services is failed
|
||||
- "'could not find' not in (_dokploy_remove_services.msg | default('') | lower)"
|
||||
- "'not found' not in (_dokploy_remove_services.msg | default('') | lower)"
|
||||
tags: dokploy, deletion
|
||||
|
||||
- name: Leave Docker Swarm
|
||||
become: true
|
||||
community.docker.docker_swarm:
|
||||
state: absent
|
||||
ignore_errors: true
|
||||
register: _dokploy_swarm_leave
|
||||
failed_when:
|
||||
- _dokploy_swarm_leave is failed
|
||||
- "'not part of a swarm' not in (_dokploy_swarm_leave.msg | default('') | lower)"
|
||||
- "'not a swarm manager' not in (_dokploy_swarm_leave.msg | default('') | lower)"
|
||||
tags: dokploy, deletion
|
||||
|
||||
- name: Remove Dokploy network
|
||||
@@ -24,10 +32,14 @@
|
||||
community.docker.docker_network:
|
||||
name: "{{ dokploy_docker_network }}"
|
||||
state: absent
|
||||
ignore_errors: true
|
||||
register: _dokploy_remove_network
|
||||
failed_when:
|
||||
- _dokploy_remove_network is failed
|
||||
- "'not found' not in (_dokploy_remove_network.msg | default('') | lower)"
|
||||
tags: dokploy, deletion
|
||||
|
||||
- name: Remove Dokploy configuration directory
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "{{ dokploy_config_dir }}"
|
||||
state: absent
|
||||
@@ -43,13 +55,17 @@
|
||||
- dokploy-postgres-database
|
||||
- redis-data-volume
|
||||
- dokploy-docker-config
|
||||
register: _dokploy_remove_volumes
|
||||
failed_when:
|
||||
- _dokploy_remove_volumes is failed
|
||||
- "'no such volume' not in (_dokploy_remove_volumes.msg | default('') | lower)"
|
||||
- "'not found' not in (_dokploy_remove_volumes.msg | default('') | lower)"
|
||||
when: dokploy_remove_data_on_absent | bool
|
||||
ignore_errors: true
|
||||
tags: dokploy, deletion, volumes
|
||||
|
||||
- name: Display uninstallation message
|
||||
ansible.builtin.debug:
|
||||
msg:
|
||||
- "Dokploy has been uninstalled"
|
||||
- "Application data preserved: {{ not dokploy_remove_data_on_absent }}"
|
||||
- "Data removed: {{ dokploy_remove_data_on_absent | bool }}"
|
||||
tags: dokploy, deletion
|
||||
|
||||
Reference in New Issue
Block a user