I am using ansible and docker_container module. But when I start my playbook, I have error like:
"'depends_on' is not a valid attribute for a Task"
This is my playbook:
- name: Docker-compose
hosts: localhost
connection: local
gather_facts: no
tasks:
- name: Start selenium hub
docker_container:
name: hub
image: selenium:latest
state: started
restart: yes
ports:
- "4444:4444"
- name: Start chromedriver
docker_container:
name: chromedriver
image: chromedriver:latest
state: started
restart: yes
depends_on:
- "hub"
links:
- "hub:hub"
env:
VNC_ENABLED: true
EXPOSE_X11: true
ports:
- "5900:5900"
As you can see container with name 'chromedriver' depends on 'hub'. How can I do this?