Search code examples
ansibleansible-awx

Failed to change ownership of the temporary files Ansible needs to create despite connecting as a privileged user


I am new to awx i use pre-exsisting playbook when i run it from ubuntu 20 terminal it works fine but i want to run it through awx when i run it from awx i get this error.

Failed to change ownership of the temporary files Ansible needs to create despite connecting as a privileged user. Unprivileged become user would be unable to read the file`

I install nextcloud from blog and i use these two commands at the end.

chown -R www-data:www-data /var/www/html/nextcloud
chmod -R 775 /var/www/html/nextcloud

the task where it throw error is this:

---
# tasks file for upgrade-nextcloud

- name: "[NC-Upgrade] - Get current version."
  become_user: "{{ nextcloud_websrv_user }}"
  command: php occ status --output=json
  args:
    chdir: "{{ nextcloud_webroot }}"
  register: nc_current_version
  changed_when: false

where become_user: "{{ nextcloud_websrv_user }}" is www-data. When i run it become_user: root then it say /var/www/html/nextcloud directory not found.

Do i need to mount the directory /var/www/html/nextcloud in awx_web container if i run it as a root.


Solution

  • The issue is fix the only problem is

    connection:local 
    

    in main.yml so just need to remove it and i run it on a remote machine and also didn't provide the ssh credentials.