sudo: true in ansible affects the remote (managed) nodes.

The user running ansible will need to be able to access the files on the
local end, so sudo ansible itself in that case if you need to read
/tmp/root.txt and can't as you.





On Wed, Jul 2, 2014 at 3:33 AM, <[email protected]> wrote:

>
> 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
> <https://groups.google.com/d/msgid/ansible-project/04a8e5fc-5b1d-4a99-a3f4-f48e6ee62c5c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CA%2BnsWgwwsTMf57GrADU16VEgp5XU%3Ds2yvAR%3DMsQ%2BfKaPCUX-wQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to