Two different version of ansible gives two different outputs for same ansible playbook

  - hosts: Ebonding
    become: yes
    become_method: sudo
    tasks
      - name: Clearing cache of Server4
        file: path=/weblogic/bea/user_projects/domains/tmp state=absent
        become: yes
        become_user: wls10 

Ansible version 2.0.0.0 run the above playbook successfully::

    PLAY     ***************************************************************************

    TASK [setup] *******************************************************************
    ok: [ggnqinfa2]

    TASK [Clearing cache of Server4] *********************************************** 
    ok: [ggnqinfa2]

    PLAY RECAP *********************************************************************
    ggnqinfa2                  : ok=2    changed=0    unreachable=0    failed=0

 

But latest version of ansible 2.5.0rc2 encountered below error::

PLAY [Ebonding] *****************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************
ok: [ggnqinfa2]

TASK [Clearing cache of Server4] ************************************************************************************************************************************
fatal: [ggnqinfa2]: FAILED! => {"msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user (rc: 2, err: chown: /var/tmp/ansible-tmp-1520704924.34-191458796685785/: Not owner\nchown: /var/tmp/ansible-tmp-1520704924.34-191458796685785/file.py: Not owner\n}). For information on working around this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user"}
 PLAY RECAP **********************************************************************************************************************************************************
 ggnqinfa2                  : ok=1    changed=0    unreachable=0    failed=1
 

How can i run this playbook by latest version of ansible successfully?

By open the link and read and implement one of the solution.

Hello Kai

Thanks for your response.

Now i am getting below warning ::

[WARNING]: Using world-readable permissions for temporary files Ansible needs to create when becoming an unprivileged user. This may be insecure. For information
on securing this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user

I tried below two method two hide this warning but ansible is ignoring both of these method.Please help me to get rid of that WARNING

1. ignore_warnings: yes

2. args:

warn: False

With Regards

-Mahendra Raghuwanshi

I think you must have read the wrong link because that link doesn't mention ignore_warnings: or warn: at all.

No , Kai you misunderstood…i am saying that I got the solution for “becoming an unprivileged user” from the link you mentionned.

Now i am getting below warning ::
[WARNING]: Using world-readable permissions for temporary files Ansible needs to create when becoming an unprivileged user. This may be insecure

And i tried these two methods to get rid of that warning

  1. ignore_warnings: yes
  2. args:
    warn: False

But ansible is ignoring these two methods and i am still getting the warning while running the playbook. So , please hep how can i hide this warning from the output of my playbook

Thanks

-Mahendra Raghuwanshi