My question is how can I copy a file from the Ansible node to the
configured nodes when the file is only accessible by the root user.
Using the copy module directly does not work, so now I have to make some
tricky tasks like that:
- hosts: all
sudo: true
tasks:
- local_action: shell cp /tmp/root.txt /tmp/root.txt,copy
creates=/tmp/root.txt.copy
- local_action: file path=/tmp/root.txt.copy mode=0644
- copy: src=/tmp/root.txt.copy dest=/tmp/pr.txt
Is there any other way to do it?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/04a8e5fc-5b1d-4a99-a3f4-f48e6ee62c5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.