Dear all,

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. It still works fine for statically included tasks. This seems to be the the now documented way of attribute inheritance since ansible 2.5 and it probably came to us with a recent `yum upgrade` which updated ansible from 2.4 to 2.6 in one big step.

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.

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?


Personally I find this new behaviour suboptimal regarding maintenance, intuitive understanding of playbooks and scalability. All things, that I appreciated with ansible so far.

Cheers
frank



[*] i.e. we have e.g. the same tag "sysconfig" applied to an included taskfile for the role "common" and for the role "hw-server" and for the role "webserver", allowing us to run the complete system configuration with --tags=sysconfig


--
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/6bab2473-402c-2f95-7f8b-494ba78731eb%40drosera.ch.
For more options, visit https://groups.google.com/d/optout.

Reply via email to