I am running an ansible script on
localhost to copy a folder to another location.
- name: Copy Network become: yes become_user: root copy: src: /d/ dest: "/dest/d/" mode: 0644 tags: [network]
is giving me
[Errno 13] Permission denied: b'd/f1'. I was expecting
become_user will make the command execute as root, didn't work.
The permission of this file is
Can you please give me pointers to get access to this file to copy it using ansible?
sudo ansible-playbook p.ymlworks perfectly however, I don't want to use
sudowith ansible command if it's not required and ansible has a trick for it.
command: cp -r /d/ /dest/d/works without appending
sudoto the ansible command (
ansible-playbook p.yml). However, I don't want to use
commandif I can help it because of idempotence &
modeoption required for the task.