If I understand correctly what you want...

ansible-playbook myplaybook.yml --tags=myspecialtag is what you're looking for...

A tag can be use in more than one task...

The doc :
http://docs.ansible.com/ansible/playbooks_tags.html


Regards,


Le 2016-03-15 13:08, Branko Majic a écrit :
Hello folks,

Is it possible to use tags as a variable inside of playbook?

Specifically, I would like to have a condition to execute certain task
only if a tag has been defined.

I am aware this can be done with an --extra-vars option + checking for
variable instead, but I wanted to see if I could abuse the tags system
a bit to make the syntax less verbose/clearer.

Best regards

--
Branko Majic
Jabber: [email protected]
Please use only Free formats when sending attachments to me.

Бранко Мајић
Џабер: [email protected]
Молим вас да додатке шаљете искључиво у слободним форматима.

--
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/904b866011045150ec4ea4c3cbcc4cfb%40lenhof.eu.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to