Discussion:
[ansible-project] Command line with pipes
Roman Dolgov
2015-01-30 15:09:53 UTC
Permalink
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 ?
--
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-project+***@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
2015-01-31 00:25:43 UTC
Permalink
You will need to use the shell module instead of command.
Post by Roman Dolgov
- 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 ?
--
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
.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/a4780854-8391-4e34-a2e9-6e6ec6b5351a%40googlegroups.com
<https://groups.google.com/d/msgid/ansible-project/a4780854-8391-4e34-a2e9-6e6ec6b5351a%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
Matt Martz
@sivel
sivel.net
--
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-project+***@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/CAD8N0v_eou1HvgmW%2BJg9MLHierkHSyCnjv-FXVLLFSijdFot3A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...