mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-03-15 19:58:28 +00:00
Fix docker_compose_v2 example. (#917)
This commit is contained in:
parent
48c0cdf2c5
commit
259f2cf8b7
@ -194,8 +194,13 @@ EXAMPLES = '''
|
|||||||
- name: Verify that web and db services are not running
|
- name: Verify that web and db services are not running
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- "not output.services.web.flask_web_1.state.running"
|
- web_container.State != 'running'
|
||||||
- "not output.services.db.flask_db_1.state.running"
|
- db_container.State != 'running'
|
||||||
|
vars:
|
||||||
|
web_container: >-
|
||||||
|
{{ output.containers | selectattr("Service", "equalto", "web") | first }}
|
||||||
|
db_container: >-
|
||||||
|
{{ output.containers | selectattr("Service", "equalto", "db") | first }}
|
||||||
|
|
||||||
- name: Restart services
|
- name: Restart services
|
||||||
community.docker.docker_compose_v2:
|
community.docker.docker_compose_v2:
|
||||||
@ -210,8 +215,13 @@ EXAMPLES = '''
|
|||||||
- 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:
|
||||||
- "output.services.web.flask_web_1.state.running"
|
- web_container.State == 'running'
|
||||||
- "output.services.db.flask_db_1.state.running"
|
- db_container.State == 'running'
|
||||||
|
vars:
|
||||||
|
web_container: >-
|
||||||
|
{{ output.containers | selectattr("Service", "equalto", "web") | first }}
|
||||||
|
db_container: >-
|
||||||
|
{{ output.containers | selectattr("Service", "equalto", "db") | first }}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user