Using --limit working on hosts with multiple tasks

42 views
Skip to first unread message

Mike Cavedon

unread,
Mar 22, 2014, 2:31:29 PM3/22/14
to ansible...@googlegroups.com
Hi,

I have the following set-up:

[hosts]
am[201:205]
am[301:305]

[matcher:children]
hosts

[memcached:children]
hosts

I'm expecting to be able to use "--limit matcher" and have only the tasks associated with "matcher" executed on the hosts but the tasks associated with "memcached" are also being executed. If I'm not doing something incorrectly how do I get only the tasks associated with "matcher" to execute on the hosts associated with both "matcher" and "memcached"?

Thanks.

Michael DeHaan

unread,
Mar 22, 2014, 2:58:11 PM3/22/14
to ansible...@googlegroups.com
Groups select hosts not tasks, I see the group "hosts" in both groups so this is correct.  

Consider tagging or splitting your playbooks.

-- Michael
--
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/2e979fc2-389d-428d-b9e9-32a244739f91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Cavedon

unread,
Mar 22, 2014, 3:39:06 PM3/22/14
to ansible...@googlegroups.com
I even tried the following:

[matcher:children]
am[201:205]
am[301:305]

[memcached:children]
am[201:205]
am[301:305]

I called the playbook with "--limit matcher".

Stuff for "- hosts: matcher_memcached" still executed.

No need to respond if this is expected. I will look into tags or splitting.

Thanks for the response, especially so quickly on the weekend.

Mike

Mike Cavedon

unread,
Mar 22, 2014, 3:39:44 PM3/22/14
to ansible...@googlegroups.com
Typo...

Stuff for "- hosts: memcached" still executed.

Michael DeHaan

unread,
Mar 22, 2014, 3:55:19 PM3/22/14
to ansible...@googlegroups.com
Still as designed...

-- Michael

Walid

unread,
Mar 22, 2014, 3:56:18 PM3/22/14
to ansible...@googlegroups.com
the group with children have to have child groups entries not hosts , not child hosts


Reply all
Reply to author
Forward
0 new messages