Ansible seems to ignore ansible_port_number?
I'm trying to use ansible to start several docker containers, then configure them. In my hosts file I have:
[main] 192.168.1.10:22
[containers] 192.168.1.10:122
In my playbook I have:
- hosts: main tasks: - name: start a node # start my docker container
- hosts: containers tasks: - name: make a file in the node # make a file
The behavior that I see is that ansible connects to main, starts a container, then moves to the 'make a file in the node' task and.. makes a file on main.
I'm able to connect to the container using \`ssh [192.168.1.10](https://192.168.1.10) \-p 122\` just fine, so I believe that everything in main is working as expected. It's just that when it moves to the new set of hosts, it doesn't update the port number.
The [ansible documentation](http://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#hosts-and-groups) suggests this is a valid way to specify hosts and ansible ports, so I'm not sure what's going on.
My belief is that ansible is ignoring the change in port, but I'm not sure why. Any ideas?