Not Working As Expected: main.yml - include something.yml tags=something

208 views
Skip to first unread message

Jacob

unread,
May 2, 2016, 2:15:14 PM5/2/16
to Ansible Project
Hello,

I'm writing a new playbook and executing it using ansible 2.1.0. It appears the tags I define in main.yml on an include line are being ignored. By comparison, this works as expected in ansible 1.9.2

Example:

roles/common/tasks/main.yml:

---

- include: something.yml tags=something

I would then expect to be able to run something like ansible-playbook -i hosts something.yml -t something to run just the something task or ansible-playbook -i hosts something.yml -t something --list-tasks and have the something tasks printed but it is not.

Does it no longer work this way in ansible 2? Any suggestions on how I can make this work? Essentially, I'm looking to tag ALL tasks in the something.yml play, in this example.

Jacob

unread,
May 2, 2016, 5:06:02 PM5/2/16
to Ansible Project
I found the solution here: http://docs.ansible.com/ansible/playbooks_tags.html

The syntax in this case that works for me is:

- include: something.yml
  tags: something
Reply all
Reply to author
Forward
0 new messages