Hi, 

You probably need to use the shell module instead of the command module - 
command runs commands without a shell. To use >> and 2>&1, which are thing 
that your shell gives you, you need to use the shell module.

Hope this helps,

Jon

On Thursday, April 7, 2016 at 9:10:56 AM UTC+1, mondher khas wrote:
>
>
>
> down votefavorite 
> <http://stackoverflow.com/questions/36470297/haw-to-save-the-output-of-a-script-in-a-file-ansible-2-0-2#>
>
> i want to save the output of a command in a file , i tried to use :
>
> - command: ./script1 >> file.txt 2>&1 
>
> but it's give me an empty file. Is there any other method to save the 
> output of my "script1" in a "file" using ansible 2.0.2 . thank you in 
> advance .
>

-- 
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/0e63875e-133c-4a1b-a295-dca8935a09a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to