mg
7ce808198e
bugfix no log base dir set fact state vars state Doku tasks unnütze kennwörter entfernt nutzer optional dir_name darf empty sein erstelle docker-networks Co-authored-by: Michael Grote <michael.grote@posteo.de> Reviewed-on: mg/ansible#166 Co-Authored-By: mg <mg@noreply.git.mgrote.net> Co-Committed-By: mg <mg@noreply.git.mgrote.net>
24 lines
667 B
YAML
24 lines
667 B
YAML
---
|
|
- name: set dir - "{{ item.name }}"
|
|
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
|
|
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 == true
|
|
|
|
- name: remove repository - "{{ item.name }}"
|
|
ansible.builtin.file:
|
|
state: absent
|
|
dest: "{{ project_dir }}"
|
|
when: dir.stat.exists == true
|