Command line with pipes

2,356 views
Skip to first unread message

Roman Dolgov

unread,
Jan 30, 2015, 10:09:53 AM1/30/15
to ansible...@googlegroups.com
 tasks:
   
- name: get clusters names
     command
: "ps axu | grep bin/post | egrep -o etc/postgresql/9.3/.* | awk -F '/' '{print $4}'"



That command doesn't work in ansible-playbook,  but works fine in shell, I got error about wrong arguments of ps tool.
How I could use pipes with ansible command ?

Matt Martz

unread,
Jan 30, 2015, 7:25:48 PM1/30/15
to ansible...@googlegroups.com
You will need to use the shell module instead of command.
--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a4780854-8391-4e34-a2e9-6e6ec6b5351a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Matt Martz
@sivel
sivel.net

Reply all
Reply to author
Forward
0 new messages