This commit is contained in:
@@ -49,12 +49,18 @@
|
||||
recreate: always
|
||||
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
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- '"movie-db-web" in compose_output.services'
|
||||
- 'compose_output.services["movie-db-web"].state == "running"'
|
||||
- '"movie-db-db" in compose_output.services'
|
||||
- 'compose_output.services["movie-db-db"].state == "running"'
|
||||
- container_info.containers is defined
|
||||
- (container_info.containers | selectattr('name', 'equalto', '{{ project_name }}-web-1') | first).State.Running
|
||||
- (container_info.containers | selectattr('name', 'equalto', '{{ project_name }}-db-1') | first).State.Running
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user