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 .
J Hawkesworth
unread,
Apr 7, 2016, 5:58:34 AM4/7/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
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
mondher khas
unread,
Apr 7, 2016, 6:31:09 AM4/7/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message