I ran into what seemed to me like a strange problem today, but I might just
lack the understanding to know what was happening.
Let's say you have a YAML file called ec2.yml to run against that looks
like this:
---
- hosts: tag_ansible_host1
roles:
- role1
- role2
- hosts: tag_ansible_host2
roles:
- role2
Both of these hosts are at ec2 and you are using the ec2 dynamic inventory
script. Both hosts are also tagged with ansible:host1 and ansible:host2.
I was in a similar situation today and ran a similar command to the
following:
ansible-playbook -l tag_ansible_host2 ec2.yml
What I expected to happen was that ansible would only run role2 on both
hosts since I specified the limit flag. However, what happened was that
ansible began running role1 and role2 on both hosts. I suspect either I am
just missing something about how the limit flag works. Can anyone help me
understand what I did wrong?
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/38d66af9-3106-41c2-a8ee-e9d85f7f1427%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.