module - ansible shell escape single and double quotes -


i'm trying execute command:

ps -eo pid,args --cols=10000 | awk '/\/opt\/logstash\/logstash-1.5.3\// && $1 != procinfo["pid"] { print $1 }' 

whith ansible -m shell module (not working example):

ansible -m shell -a '"'ps -eo pid,args --cols=10000 | awk '/\/opt\/logstash\/logstash-1.5.3\// && $1 != procinfo[\'pid\'] { print $1 }' '"' 

one of ways put file, still nice run command - ideas?

bash escaping rules do:

ansible localhost -m shell -a "ps -eo pid,args --cols=10000 | awk '/\\/opt\\/logstash\\/logstash-1.5.3\\// && \$1 != procinfo[\"pid\"] { print \$1 }'" 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -