On Friday, 24 August 2018 15.47.39 CEST Frank Thommen wrote:
> since "recently" (we realized just now), tags applied in role's main.yml 
> task, like:
> 
> /role/myrole/tasks/main.yml:
> 
> - name: My Task
>    include_tasks: "mytask.{{ansible_osfamily}}.yml"
>    tags:
>      - mytask-only
>      - always
> 
> are not propagated to the included task any more.

<skip />


> However this is a major pain for us: We are extensively using unified, 
> role-spanning[*] tags on the level of the the main tasks to be able to 
> selectively roll out our configurations.  The new behaviour means, that 
> we have to manually add hundreds(!) of "tag" statements to each 
> individual task in all the included taskfiles.

You don't need to add it to every task, you can use a block: around them all 
and set the tag on the block.

You can also wrap the include_tasks in a block, and set the tags on the block.

  - block:
    - name: My Task
      include_tasks: "mytask.{{ansible_osfamily}}.yml"
    tags:
      - mytask-only
      - always


> Is there a way to achieve the former behaviour (tag inheritance to 
> dynamic includes) other than framing each task.yml with a block, which 
> introduces redundancy and error-proneness?

Only the workaround mention above, but you can always downgrade.
There are some discussion don't remember if it was in an issue or on this list 
about a option or something like that to tell if it should propagate or not.


-- 
Kai Stian Olstad


-- 
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/2496778.GzZQfz6e8i%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to