Mounting Volumes when using Docker module in Ansible
Here is a snippet from my Ansible playbook …
My problem is that I can not get the host and container to mount. The specific line is:
If I simply change the line to the below the container starts fine, but there is no mount to the host
I am also not sure how I can find any logging to trace is there is a permissions issue or something like that.
Using Ansible 188.8.131.52 and Docker 1.12.3 on Ubuntu Trusty.
- name: docker and jenkins docker: name: jenkins image: jenkins state: started ports: - "8080:8080" - "50000:50000" volumes: **- /home/vagrant/programs/jenkins:/var/jenkins_home:rw**
One Solution collect form web for “Mounting Volumes when using Docker module in Ansible”
I think it has something to do with your host permissions. Have you tried executing as root, or using
become in playbook?