playbook --limit

37 views
Skip to first unread message

vadimv Vatlin

unread,
Feb 9, 2015, 9:00:23 AM2/9/15
to ansible...@googlegroups.com
This is my hosts:
[main_node]
1.2.3.4

[child_node]

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

Matt Martz

unread,
Feb 9, 2015, 10:53:11 AM2/9/15
to ansible...@googlegroups.com
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

--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@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.
For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
@sivel
sivel.net
Reply all
Reply to author
Forward
0 new messages