29 lines
702 B
YAML
29 lines
702 B
YAML
- hosts: leader
|
|
become: "true"
|
|
vars:
|
|
stack_name: "cleanup"
|
|
tasks:
|
|
####################
|
|
# - Stack Deployment
|
|
####################
|
|
- name: "Upload Stack to /tmp"
|
|
template:
|
|
src: "./docker-compose.yml"
|
|
dest: "/tmp/{{ stack_name }}.yml"
|
|
owner: "root"
|
|
group: "root"
|
|
mode: "0640"
|
|
|
|
- name: "Deploy Stack: {{ stack_name }}"
|
|
community.docker.docker_stack:
|
|
state: "present"
|
|
prune: "true"
|
|
name: "{{ stack_name }}"
|
|
compose:
|
|
- "/tmp/{{ stack_name }}.yml"
|
|
|
|
- name: "Delete /tmp Stack"
|
|
ansible.builtin.file:
|
|
path: "/tmp/{{ stack_name }}.yml"
|
|
state: "absent"
|