I'm trying to recreate the following docker commands with the docker module:

- name: Jenkins data directory
  shell: "docker create -v {{ansible_env.HOME}}/.jenkins:/var/jenkins_home 
--name jenkins.data jenkins"

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

I've tried 

- name: Jenkins data directory
  docker: 
    name: jenkins.data 
    image: 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  

but it doesn't work

Where am I going wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/76f3c4d9-3c8e-4143-9a4d-36ab5dbbee57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to