# Issues with Ansible Docker module

**URL:** <https://forum.ansible.com/t/issues-with-ansible-docker-module/18700>\
**Category:** Ansible Project\
**Created:** [July 7, 2015, 12:34pm UTC](https://forum.ansible.com/t/issues-with-ansible-docker-module/18700 "2015-07-07T12:34:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anthony\_Green](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@Anthony\_Green](https://forum.ansible.com/u/Anthony_Green)\
**Post date:** [July 7, 2015, 12:34pm UTC](https://forum.ansible.com/t/issues-with-ansible-docker-module/18700/1 "2015-07-07T12:34:43Z")

</div>

These tasks

- name: Create Jenkins data directory on host  
file: “path=/home/{{ansible\_ssh\_user}}/.jenkins state=directory mode=0777”

- name: Jenkins data directory  
shell: “docker create -v {{ansible\_env.HOME}}/.jenkins:/var/jenkins\_home --name jenkins.data mediaplayout/jenkins”  
sudo: yes

- name: Run Jenkins container  
shell: docker run -d -p 8080:8080 -p 50000:50000 --volumes-from jenkins.data --name jenkins.master mediaplayout/jenkins  
sudo: yes

generates a docker container with a volume that is shared with the host at ~/.jenkins

These tasks:

- name: Create Jenkins data directory on host  
file: “path=/home/{{ansible\_ssh\_user}}/.jenkins state=directory mode=0777”

- name: Jenkins data directory  
docker:  
name: jenkins.data  
image: mediaplayout/jenkins  
state: present  
volumes: “/home/{{ansible\_ssh\_user}}/.jenkins:/var/jenkins\_home”  
sudo: yes

- name: Start Jenkins container  
docker:  
name: jenkins.master  
image: mediaplayout/jenkins  
pull: always  
state: started  
volumes\_from:

- ‘jenkins.data’  
ports:

- 8080:8080

- 50000:50000  
sudo: yes

don’t shared the directory at that location

Is the second playbook correct or is there a issue with the Ansible docker module?
