Skip to content

Commit

Permalink
#243 stupid test: can docker_compose talk to Docker?
Browse files Browse the repository at this point in the history
  • Loading branch information
Don Sizemore committed May 21, 2024
1 parent e2977e0 commit 2bf4123
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions tasks/minio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,32 +55,35 @@
- minio_dir.stat.exists
- minio_dir.stat.isdir

- name: STORAGE | Get infos on container
community.docker.docker_container_info:
name: "{{ minio.docker.service_name }}"
register: minio_container
# barf: community.docker.docker_container_info can't call the Docker API
# - name: STORAGE | Get infos on container
# community.docker.docker_container_info:
# name: "{{ minio.docker.service_name }}"
# register: minio_container

- name: STORAGE | Check docker compose file
ansible.builtin.stat:
path: "{{ minio.docker.project_location }}/minio_compose.yml"
register: compose_file

- name: STORAGE | Stop `docker-compose down` MinIO
community.docker.docker_compose:
project_src: "{{ minio.docker.project_location }}"
state: absent
remove_orphans: true
become: true
register: continer_stop
when:
- minio_container.exists
- copy_compose.changed

# no need to stop a non-existant container
# - name: STORAGE | Stop `docker-compose down` MinIO
# community.docker.docker_compose:
# project_src: "{{ minio.docker.project_location }}"
# state: absent
# remove_orphans: true
# become: true
# register: continer_stop
# when:
# - minio_container.exists
# - copy_compose.changed
#
# can community.docker.docker_compose talk to Docker?
- name: STORAGE | Run `docker-compose up` MinIO
community.docker.docker_compose:
project_src: "{{ minio.docker.project_location }}"
build: true
files: minio_compose.yml
when: (not minio_container.exists and minio_dir.stat.isdir and compose_file.stat.exists) or continer_stop.changed
#when: (not minio_container.exists and minio_dir.stat.isdir and compose_file.stat.exists) or continer_stop.changed

- ansible.builtin.import_tasks: minio_jvm_options.yml

0 comments on commit 2bf4123

Please sign in to comment.