This commit is contained in:
@@ -49,12 +49,18 @@
|
|||||||
recreate: always
|
recreate: always
|
||||||
register: compose_output
|
register: compose_output
|
||||||
|
|
||||||
|
- name: Get container info
|
||||||
|
community.docker.docker_container_info:
|
||||||
|
name:
|
||||||
|
- "{{ project_name }}-web-1"
|
||||||
|
- "{{ project_name }}-db-1"
|
||||||
|
register: container_info
|
||||||
|
|
||||||
- name: Verify that web and db services are running
|
- name: Verify that web and db services are running
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- '"movie-db-web" in compose_output.services'
|
- container_info.containers is defined
|
||||||
- 'compose_output.services["movie-db-web"].state == "running"'
|
- (container_info.containers | selectattr('name', 'equalto', '{{ project_name }}-web-1') | first).State.Running
|
||||||
- '"movie-db-db" in compose_output.services'
|
- (container_info.containers | selectattr('name', 'equalto', '{{ project_name }}-db-1') | first).State.Running
|
||||||
- 'compose_output.services["movie-db-db"].state == "running"'
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user