kayobe/ansible/roles/deploy-containers/tasks/destroy-container.yml
Will Szumski 2c58388ac3 Add seed service destroy
This can be useful when using a seed VM that is not deployed by kayobe,
and can therefore not use ``kayobe seed deprovision``, especially when
iterating on kayobe-config during the inital stages of a deployment, or
for development, where you want to re-run the playbooks from a clean-ish
state.

Change-Id: I43a9c2a57fcfe2c9d84f39903aac7c258f9a897f
2024-06-03 16:25:32 +00:00

16 lines
502 B
YAML

---
- name: "[{{ container_name }}] Include tasks file for pre destroy task(s)"
include_tasks: "{{ container_config.pre_destroy }}"
when: container_config.pre_destroy is defined
- name: "[{{ container_name }}] Delete container"
docker_container:
name: "{{ container_name }}"
state: absent
become: true
- name: "[{{ container_name }}] Include tasks file for post destroy task(s)"
include_tasks: "{{ container_config.post_destroy }}"
when: container_config.post_destroy is defined