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:
– /home/vagrant/programs/Jenkins:/var/jenkins_home:rw

  • Updating docker-compose Ubuntu 15.10
  • Remote Node.js typescript debugging in WebStorm
  • How to move docker containers using device mapper to another machine without using docker commands
  • I need to run my node app using this Docker file
  • Xdebug IP changed when VPN Is active
  • Dockerized PHP Application Architecture Best Practices
  • If I simply change the line to the below the container starts fine, but there is no mount to the host
    – /home/vagrant/programs/Jenkins

    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 and Docker 1.12.3 on Ubuntu Trusty.

    - name: docker and jenkins
        name: jenkins
        image: jenkins
        state:  started
        - "8080:8080"
        - "50000:50000"
       **- /home/vagrant/programs/jenkins:/var/jenkins_home:rw**



  • Docker pulling windows image - failed to register layer: re-exec error: exit status 1
  • Get docker run command for container
  • docker PHP-APACHE "You don't have permission to access / on this server”
  • Choose available memory for containers in Rancher
  • Pass --net=host to docker build
  • AWS ECR Authentication Test
  • 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?

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.