Ok, communication issue on my end.

"doit" does get applied to everything, and we are good there (no bugs!)

It isn't true that adding a tag to the "include" statement you have
manually inside the role would affect the deps.  That would only affect the
included tasks in that file.

Sorry for confusion!



On Fri, Oct 24, 2014 at 8:02 PM, Michael DeHaan <mich...@ansible.com> wrote:

> "since tags applied directly to tasks (like your include statements in
> tasks/main.yml) are not applied to dependent roles (nor would we expect
> them to be)"
>
> I may have been confused with the discussion.
>
> I do expect tags like this:
>
> - hosts: webservers
>   roles:
>     - { role: doit, tags: doit }
>     - { role: other, tags: other }
>
> That dependent roles of "doit" run when you say "doit".
>
>
>
> On Fri, Oct 24, 2014 at 12:45 PM, James Cammarata <jcammar...@ansible.com>
> wrote:
>
>> Hi Daniel,
>>
>> Michael and I ran through this and we agree this is operating as
>> expected, since tags applied directly to tasks (like your include
>> statements in tasks/main.yml) are not applied to dependent roles (nor would
>> we expect them to be). So, as I suggested in my reply, you just need to add
>> whatever additional tags may be required to your dependency definitions and
>> you should be good to go.
>>
>> Let us know if you have any further questions regarding this.
>>
>> Thanks!
>>
>> On Fri, Oct 24, 2014 at 9:17 AM, Daniel Wendler <
>> daniel.wendler....@gmail.com> wrote:
>>
>>> The version is ansible 1.7.2 (1.7.2+dfsg-2~bpo70+1 - installed from
>>> distri repo debian wheezy)
>>>
>>> Yes, i narrowed the scope of my tag because i want to run only an subset
>>> of tasks of the role.
>>> But as this are tasks in the monitoring role, i was expecting the
>>> dependency is triggered an the monitoring-basic role is run anyway.
>>> I can tag the dependenies also with an whole bunch of tags, but in that
>>> case i have to think about it an on every addition in the monitoring role
>>> with an other tag
>>> i also have to adjust the dependency tags.
>>>
>>> Am Freitag, 24. Oktober 2014 15:12:17 UTC+2 schrieb Michael DeHaan:
>>>>
>>>> I'm not sure that's intuitive.
>>>>
>>>> By tagging all things with "monitoring", everything should get a
>>>> "monitoring".
>>>>
>>>> additionally, the included tasks add a "monitoring:crc"
>>>>
>>>> I would expect tags should be additive, and "narrowing the scope of
>>>> your tags" is not a thing that should be a language concept IMHO.
>>>>
>>>>
>>>>
>>>>
>>>> On Fri, Oct 24, 2014 at 8:40 AM, James Cammarata <jcamm...@ansible.com>
>>>> wrote:
>>>>
>>>>> This is happening because you have narrowed the scope of your tags,
>>>>> and the dependent role is only inheriting the "monitoring" tag from its
>>>>> parent role. If you still need to have your deps run when other tags are
>>>>> specified, you can add them to the list of tags on the dependency:
>>>>>
>>>>> - dependencies:
>>>>>   - { role: monitoring a basics, tags: monitoring:crc }
>>>>>
>>>>> The same will go for your other tags, which you can add to the list.
>>>>>  On Oct 24, 2014 7:17 AM, "Michael DeHaan" <mic...@ansible.com> wrote:
>>>>>
>>>>>> For starters, ansible --version output?
>>>>>>
>>>>>>
>>>>>> On Fri, Oct 24, 2014 at 5:29 AM, Daniel Wendler <
>>>>>> daniel.we...@gmail.com> wrote:
>>>>>>
>>>>>>> Hello @all,
>>>>>>>
>>>>>>> i have an strage behavior with role dependencies and tags.
>>>>>>> I have an playbook like this:
>>>>>>>
>>>>>>> ---
>>>>>>> - name: install and configure a basic set of tools
>>>>>>>   gather_facts: true
>>>>>>>   hosts:
>>>>>>>     - is
>>>>>>>
>>>>>>>
>>>>>>>   roles:
>>>>>>>     - { role: monitoring, tags: monitoring }
>>>>>>>     - { role: other, tags: other }
>>>>>>>
>>>>>>> In the "monitoring" role i have a dependency:
>>>>>>> ---
>>>>>>> dependencies:
>>>>>>>   - { role: monitoring-basics }
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> and in the tasks/main.yml i have some includes:
>>>>>>> ---
>>>>>>> - include: bm-crc.yml tags=monitoring:crc
>>>>>>>
>>>>>>> - include: bm-hostnotes.yml tags=monitoring:hostnotes
>>>>>>>
>>>>>>> - include: bm-vital.yml tags=monitoring:vital
>>>>>>>
>>>>>>> So when i run the playbook with "ansible-playbook playbook.yml
>>>>>>> --tags=monitoring" all went fine, the dependency role is executet bevor 
>>>>>>> all
>>>>>>> task in the main.yml.
>>>>>>> But when i try to run a subset of taks with "ansible-playbook
>>>>>>> playbook.yml --tags=monitoring:crc" only the monitoring:crc tasks are
>>>>>>> executed but NOT the dependent role.
>>>>>>> Is this a wanted behavior?
>>>>>>> From my point of view dependencies should executed every time i try
>>>>>>> to run somethin on the monitoring role even when i try to run an subset.
>>>>>>>
>>>>>>> Greeting Daniel
>>>>>>>
>>>>>>> --
>>>>>>> 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/
>>>>>>> 2fe87927-b537-4ac7-ad19-d1bb9562ca5a%40googlegroups.com
>>>>>>> <https://groups.google.com/d/msgid/ansible-project/2fe87927-b537-4ac7-ad19-d1bb9562ca5a%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>>  --
>>>>>> 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/CA%2BnsWgwxsnL1THN-m3PM3vEOM1CH7aATKMogdrvd%
>>>>>> 2BCzwucroKQ%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwxsnL1THN-m3PM3vEOM1CH7aATKMogdrvd%2BCzwucroKQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>  --
>>>>> 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/CAMFyvFi9HAJ%2B0%2BV5RuTJYxRqpRtLxyisQeBUW_JCc%
>>>>> 3DC1kc4otQ%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/ansible-project/CAMFyvFi9HAJ%2B0%2BV5RuTJYxRqpRtLxyisQeBUW_JCc%3DC1kc4otQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>  --
>>> 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-project+unsubscr...@googlegroups.com.
>>> To post to this group, send email to ansible-project@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/deb92d92-9b90-41a7-94e8-dfe777a1a18d%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/deb92d92-9b90-41a7-94e8-dfe777a1a18d%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
>> 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-project+unsubscr...@googlegroups.com.
>> To post to this group, send email to ansible-project@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAMFyvFiQ-SqyoOUt3RpDCYuUiYTpJZOZ8B2tWKMZ%2BunnzhMW0A%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CAMFyvFiQ-SqyoOUt3RpDCYuUiYTpJZOZ8B2tWKMZ%2BunnzhMW0A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyyyqDrU9Thhn4MUhMngdtLMSam2HXQOoZygk2hEzMDPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to