On 23.04.2018 18:27, ProfHase wrote:
> Hi all, apparently attributes on include tasks are not propagated to
> the
> tasks anymore in 2.5
>
> For some reasons i need dynamic includes.
>
>
>> 1. How would I pass `become` to `include_role`
>>
>>
> The usecase: When I develop a role, it is sometimes based on dynamic
> facts.
>
> In my role I often use the following pattern:
>
> # tasks/main.yml
>
> - include_tasks: preparation.yml
>
> - include_tasks: configuration.yml
> become: True
>
> - include_tasks: finish.yml
> become: True
>
> As all of the tasks in `configuration.yml` require `become` And I am
> trying to avoid redundancy. On the other Hand I would not like people
> to
> have to include the role with a global `become` statement.
It's explained in the porting guide
https://docs.ansible.com/ansible/2.5/porting_guides/porting_guide_2.5.html#dynamic-includes-and-attribute-inheritance
--
Kai Stian Olstad