Thanks a lot Matt for guiding towards the correct solution. :)

On Tuesday, 21 May 2019 20:09:28 UTC+5:30, Matt Martz wrote:
>
> In Ansible 2.7 we silently ignored `become_user` on `include_tasks`, so it 
> wasn't actually doing anything for you.
>
> Arguments applied to `include_tasks` only affect the include and not the 
> tasks within, and become does nothing in that situation.
>
> I believe what you want, is the functionality that `apply` gives you.
>
> - name: Call **** installation tasks for {{ ansible_distribution|upper }}
>   include_tasks: "{{ ansible_distribution|lower }}_****_install.yaml"
>   args:
>     apply:
>       become_user: root
>
> Also, note that `become_user` defaults to `root`.
>
> On Tue, May 21, 2019 at 9:35 AM Gaurav Arora <[email protected] 
> <javascript:>> wrote:
>
>> Hi
>> We are upgrading from Ansible 2.7 to Ansible 2.8. We have following lines 
>> which are working perfectly fine with Ansible 2.7
>>
>> *# tasks file for *****
>> *- name: Call **** installation tasks for {{ ansible_distribution|upper 
>> }}*
>> *  include_tasks: "{{ ansible_distribution|lower }}_****_install.yaml"*
>> *  become_user: root*
>>
>> But when we run it with Ansible2.8, we get the following error:
>> *ERROR! 'become_user' is not a valid attribute for a TaskInclude*
>>
>> We checked the change logs but did not find anything related to this. Can 
>> anyone help us out here?
>>
>> Thank You
>>
>> -- 
>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/c046f49f-d61d-40a9-8668-4d8659ba5ea3%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/c046f49f-d61d-40a9-8668-4d8659ba5ea3%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Matt Martz
> @sivel
> sivel.net
>

-- 
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/7f31fcbb-d0ce-45a5-a757-8958a0a571d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to