Docker Module. Defining Ports

Hi,

I’m trying to start Docker using the core module provided by Ansible and I’m running into issues defining ports forwarding.

It is currently defined as:
ports: “40000:8185,40001:22,40002:61000”

When the playbook runs, only port 22 gets exposed correctly.

According to the output of docker ps, all 3 ports are exposed, however, the host machine has only opened port 40001. Ports 40000 and 40002 are closed.

I started Docker through the command line using the raw module in Ansible and everything works correctly so it must be something up with the way the Docker module is working.

Anybody have suggestions? Any help would be much appreciated.

Thanks