I have an ansible-playbook.yml
file and from inside I need to execute docker-compose
:
- name: copy sql schema
hosts: test-mysql
gather_facts: no
tasks:
- name: Docker compose
command: docker-compose -f {{ name }}_compose.yml up -d
But I always get error:
fatal: [test-mysql]: FAILED! => {"changed": false, "cmd": "docker-compose Mick_compose.yml up -d", "failed": true, "msg": "[Errno 2] No such file or directory", "rc": 2}
Any tips ? Thanks
With command: - name: Make sure compose service is up docker_compose: project_src: /path/to/your/compose/project files: - {{ name }}_compose.yml state: present I get error: The offending line appears to be:
- name: Make sure compose service is up
docker_compose:
^ here