> I would just give tasks that have both foo and bar as tags a third tag 
that will allow those tasks to be run

Unfortunately this won't work for me. I have multiple roles imported in my 
playbook:

    - { role: a, tags: ["a"] }
    - { role: b, tags: ["b"] }
    - { role: b, tags: ["c"] }
    - { role: c, tags: ["d"] }

So all tasks within role a inherit the tag a, the tasks within role b 
inherit the tag b, and so forth.

Inside these roles, some tasks are tagged with, say "x". I want to execute 
the "x" task in role "b".

On Thursday, October 12, 2017 at 3:12:53 PM UTC+11, [email protected] 
wrote:
>
> I don't think so. In this case, I would just give tasks that have both foo 
> and bar as tags a third tag that will allow those tasks to be run. It's a 
> little cumbersome, but it would work. However, as far as I know, there is 
> no AND type of operator for tags.
>
> On Thursday, October 12, 2017 at 12:04:20 PM UTC+11, Behrang Saeedzadeh 
> wrote:
>>
>> For example, let's pretend we have these tasks:
>>
>> - name: Task 1
>>   tags:
>>     - foo
>>     - bar
>>
>> - name: Task 2
>>   tags:
>>     - foo
>>
>> - name: Task 3
>>   tags:
>>     - bar
>>
>> Is there a way to only execute tasks that have both of *foo* and bar 
>> *tags*? That's, only execute* Task 1*?
>>
>

-- 
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/139126a0-3455-4cc2-8f76-216622bf9309%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to