# playbook --limit

**URL:** <https://forum.ansible.com/t/playbook-limit/17472>\
**Category:** Ansible Project\
**Created:** [February 9, 2015, 2:00pm UTC](https://forum.ansible.com/t/playbook-limit/17472 "2015-02-09T14:00:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vadimv\_Vatlin](https://avatars.discourse-cdn.com/v4/letter/v/ec9cab/32.png) [@vadimv\_Vatlin](https://forum.ansible.com/u/vadimv_Vatlin)\
**Post date:** [February 9, 2015, 2:00pm UTC](https://forum.ansible.com/t/playbook-limit/17472/1 "2015-02-09T14:00:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [February 9, 2015, 3:52pm UTC](https://forum.ansible.com/t/playbook-limit/17472/2 "2015-02-09T15:52:26Z")

</div>

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
