Failed to set permissions on the temporary files Ansible needs to create

Viewed 1099

I have in two Ansible roles a need to become_user for an unprivileged user (e.g. to set the git answers and to dconf dump the current settings); I have set already allow_world_readable_tmpfiles=True in the ansible.cfg file, but still have the error message

Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user (rc: 1, err: chown: changing ownership of '/var/tmp/ansible-tmp-1613484534.333031-12971-165984005608584/': Operation not permitted
     chown: changing ownership of '/var/tmp/ansible-tmp-1613484534.333031-12971-165984005608584/AnsiballZ_command.py': Operation not permitted

I do not use ACL or anything similar (and do not want to) and I do not see how to run as privileged user. My understanding of the documentation is that the problem should not exist since Ansble version 2.1.

I run on a 64bit aarch64 (raspi 4) with 5.8.0.-1015 kernel. ansible is: Ansible 2.9.9 config file = /home/frank/Data/ansibleHost/ansible.cfg configured module search path = ['/home/frank/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible executable location = /usr/bin/ansible python version = 3.8.6 (default, Sep 25 2020, 09:36:53) [GCC 10.2.0]

The task which causes the error is:

- name: write a dconf dump file before loading
  shell: dconf dump / > "{{remoteDir}}current"
  become: True
  become_user: "{{ this_user.user_name }}"
  environment:
    DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/{{ this_user.user_uid }}/bus 

which runs on a Debian bullseye freshly installed (python3).

0 Answers
Related