We did it like this:

- name: Check for previous running Wildfly instances
  shell: ps -ef | grep jboss | grep java | grep -v activemq | grep -v 
/bin/sh | grep -v grep | awk '{print $2}'
  register: ps_result

- debug: msg="{{ps_result.stdout}}"
- debug: msg="{{ps_result.stderr}}"


We are also running activemq which uses java processes, so we have to 
exclude that from our grep results.

-- 
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/15e22a28-4d6c-4a4e-9680-9b35ea9b64fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to