20 lines
459 B
YAML

- hosts: [{{ ip }}]
sudo: yes
tasks:
- name: mariadb container
docker:
name: {{ resource_name }}
image: {{ image }}
state: running
ports:
- {{ port }}:3306
env:
MYSQL_ROOT_PASSWORD: {{ root_password }}
- shell: docker exec -t {{ resource_name }} mysql -p{{ root_password }} -uroot -e "SELECT 1"
register: result
until: result.rc == 0
retries: 30
delay: 0.5