Should tags work on includes?

40 views
Skip to first unread message

Quentin Stafford-Fraser

unread,
Dec 17, 2014, 1:00:02 PM12/17/14
to ansible...@googlegroups.com
Hello all...

In the docs here it suggests that I should be able to add tags to an include statement like this:

---
- include: site.yml tags=foo

This simple playbook works fine unless I try actually doing anything with tags, like this:

ansible-playbook -i hosts foo.yml --tags foo

which gives me an error: 

 ERROR: tag(s) not found in playbook: foo.  possible values:

The documentation suggests this should work.  Am I doing something foolish?

Many thanks!
Quentin

Michael DeHaan

unread,
Dec 17, 2014, 1:09:20 PM12/17/14
to ansible...@googlegroups.com
Hi,

This was asked recently.

Tags work on task includes, and roles.

They do not currently do anything on playbook level includes.

This is something we may consider after the current refactoring effort (1.9 timeframe) completes.




--
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/d636f98b-9ac6-4930-90a3-6d726802293f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stephen Granger

unread,
Dec 17, 2014, 1:10:41 PM12/17/14
to ansible...@googlegroups.com
That's a common logical error that I've come across too. Tags aren't called, they are only applied in playbooks, someone might be able to word that better.

The only way to call a tag is when running ansible playbook.

I spoke to Michael after Ansible fest San Fran and he mentioned that other are having this issue too.

I'm not sure if this is being addressed, someone else might know off the top of their head?

Stephen

--
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/d636f98b-9ac6-4930-90a3-6d726802293f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Steve

Quentin Stafford-Fraser

unread,
Dec 17, 2014, 1:16:59 PM12/17/14
to ansible...@googlegroups.com
Thanks, all...

I can work around them for now.  Apologies for not seeing the earlier message.  I did try searching but didn't find it.  Ironic, on a Google site :-)

Q

Michael DeHaan

unread,
Dec 17, 2014, 1:52:14 PM12/17/14
to ansible...@googlegroups.com
"That's a common logical error that I've come across too. Tags aren't called, they are only applied in playbooks, someone might be able to word that better."

Unless I didn't follow, I don't think that was the above misunderstanding, but it is true that the include directive "labels" things with tags.  It's just not true you can label tags when you do a playbook include.

(It is true that including doesn't select things with certain tags, as well)

I agree -- Google is rough at search for everything but Google.com -- Gmail also, grr :)





--
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.
Reply all
Reply to author
Forward
0 new messages