Docker module choose random port if we didn't pass ports variable.

27 views
Skip to first unread message

Khoa Nguyen

unread,
Mar 30, 2015, 8:56:29 PM3/30/15
to ansible...@googlegroups.com
In 1.8.0 version, If I didn't pass "ports" variable, Docker module will not bind any port to the Docker Host. It worked correctly.
However, In 1.9.0.1, Docker module choose a random ports, and bind to Docker Host. I think there is something wrong. Please correct me if I wrong. 
If I remove this line (  ports: "{{ docker_ports|default(omit) }}" ) , the docker module works correctly.


```
  - name: Run docker container
     docker:
       image: "{{ docker_image }}"
       name: "{{ docker_name }}"
       command: "{{ docker_command|default(omit) }}"
       ports: "{{ docker_ports|default(omit) }}"
       env: "{{ docker_env|default(omit) }}"
       volumes: "{{ docker_volumes|default(omit) }}"
```
Reply all
Reply to author
Forward
0 new messages