My hosts file
ansible_user=ansible
Playbook
- name: WordPress setup
hosts: servers
gather_facts: false
remote_user: ansible
become: true
roles:
- wp
Role's task
- name: Update admin user's password
command: wp user update admin
--user_pass="{{ wp_admin_pwd }}"
args:
chdir: "/var/www/{{ domain_name }}"
become: yes
become_user: www-data
Running this playbook, an error shows up:
Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user
(rc: 1, err: chmod: invalid mode: ‘A+user:www-data:rx:allow’
Try 'chmod --help'
The user I'm using to connect to remote server, named ansible
, is a user with sudo privileges.
The WordPress installation runs under NGINX www-data user.
Am I missing something?