28 lines
772 B
YAML
28 lines
772 B
YAML
---
|
|
- name: Stop every compose stack on each host and prune Docker resources
|
|
hosts: all
|
|
gather_facts: false
|
|
vars_prompt:
|
|
- name: confirm
|
|
prompt: >-
|
|
This runs spindown.sh (docker compose down, then a full
|
|
docker image/volume prune -a) on the targeted host(s).
|
|
Type 'yes' to continue
|
|
private: false
|
|
tasks:
|
|
- name: Abort unless confirmed
|
|
ansible.builtin.fail:
|
|
msg: Aborted.
|
|
when: confirm != 'yes'
|
|
|
|
- name: Run spindown.sh
|
|
ansible.builtin.command: ./spindown.sh
|
|
args:
|
|
chdir: "/home/{{ deploy_user }}/services/{{ service_group }}"
|
|
register: _spindown
|
|
changed_when: true
|
|
|
|
- name: Show spindown output
|
|
ansible.builtin.debug:
|
|
var: _spindown.stdout_lines
|