Michael Grote
7a24089031
Reviewed-on: #584 Co-authored-by: Michael Grote <michael.grote@posteo.de> Co-committed-by: Michael Grote <michael.grote@posteo.de>
24 lines
643 B
YAML
24 lines
643 B
YAML
---
|
|
- name: set dir - "{{ item.name }}"
|
|
ansible.builtin.set_fact:
|
|
project_dir: "{{ docker_compose_base_dir }}/{{ item.dir_name | default (item.name) }}"
|
|
when:
|
|
- docker_compose_base_dir is defined
|
|
- docker_compose_projects is defined
|
|
|
|
- name: check if dir exists
|
|
ansible.builtin.stat:
|
|
path: "{{ project_dir }}"
|
|
register: dir
|
|
|
|
- name: stop container - "{{ item.name }}"
|
|
ansible.builtin.shell: docker-compose down
|
|
args:
|
|
chdir: "{{ project_dir }}"
|
|
when: dir.stat.exists
|
|
|
|
- name: remove repository - "{{ item.name }}"
|
|
ansible.builtin.file:
|
|
state: absent
|
|
dest: "{{ project_dir }}"
|
|
when: dir.stat.exists
|