Maciej Kwiek e51ac240c3 Change sudo to become in ansible resources
As we are using ansible 2.0, we should move from sudo to become to avoid
deprecation.

Change-Id: Ia084759b9c38f5c045ab14eab3af63a2ad33069f
Closes-bug: 1547430
2016-02-22 10:05:54 +01:00

23 lines
613 B
YAML

- hosts: [{{host}}]
become: yes
tasks:
- file: path=/var/lib/docker/data/{{resource_name}} state=directory
- name: mariadb container
docker:
name: {{ resource_name }}
image: {{ image }}
state: reloaded
ports:
- {{ port }}:3306
env:
MYSQL_ROOT_PASSWORD: {{ root_password }}
volumes:
- /var/lib/docker/data/{{resource_name}}:/var/lib/mysql
- shell: docker exec -t {{ resource_name }} mysql -p{{ root_password }} -uroot -e "SELECT 1"
register: result
until: result.rc == 0
retries: 15
delay: 1