Question: ERROR! 'become_user' is not a valid attribute for a TaskInclude

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

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.

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