28 lines
804 B
YAML
28 lines
804 B
YAML
|
---
|
||
|
- hosts: all
|
||
|
tasks:
|
||
|
- name: Remove old compose files
|
||
|
ansible.builtin.file:
|
||
|
path: /opt/docker/{{item}}
|
||
|
state: absent
|
||
|
with_fileglob:
|
||
|
- "/home/arya/projects/ansibletest/compose/*"
|
||
|
- name: Copy compose files
|
||
|
copy:
|
||
|
src: /home/arya/projects/ansibletest/compose/{{item}}
|
||
|
dest: /opt/docker/
|
||
|
with_fileglob:
|
||
|
- "/home/arya/projects/ansibletest/compose/*"
|
||
|
- name: stop compose
|
||
|
docker_compose:
|
||
|
project_src: /opt/docker/{{item}}
|
||
|
state: absent
|
||
|
with_fileglob:
|
||
|
- "/home/arya/projects/ansibletest/compose/*"
|
||
|
- name: start compose
|
||
|
docker_compose:
|
||
|
project_src: /opt/docker/{{item}}
|
||
|
state: present
|
||
|
with_fileglob:
|
||
|
- "/home/arya/projects/ansibletest/compose/*"
|