Ansible determines host uniqueness based on the hostname, in your case this is currently `1.2.3.4`. What you need to do is use host aliases if you intend on having 2 hosts with the same IP but different ports. Such as:
[main_node] main ansible_ssh_host=1.2.3.4 [child_node] child ansible_ssh_host=1.2.3.4 ansible_ssh_port=2222 On Mon, Feb 9, 2015 at 8:00 AM, vadimv Vatlin <vvvvat...@gmail.com> wrote: > This is my hosts: > [main_node] > 1.2.3.4 > > [child_node] > 1.2.3.4:2222 > > child_node is virtual container inside the main_node > > why > ansible-playbook --diff --limit=child_node lc.yml --list-hosts > > > playbook: lc.yml > > play #3 (main node): host count=1 > 1.2.3.4 > > play #4 (child node): host count=1 > 1.2.3.4 > > *lc.yml* > - name: main node > hosts: main_node > > roles: > - common > - zabbix-agent > > - name: child node > hosts: child_node > > roles: > - common > > -- > 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 ansible-project+unsubscr...@googlegroups.com. > To post to this group, send email to ansible-project@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/bdff5b84-a6a0-4908-bfd3-503d4cd72cea%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/bdff5b84-a6a0-4908-bfd3-503d4cd72cea%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Matt Martz @sivel sivel.net -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAD8N0v_aBj4gujYXL%2BgQHzxeoN2NdDO0f2GGF9KJuXV5gA5tAQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.