I have the below play to check if JBoss application server is RUNNING. I am getting the message "JBoss Process is running on localhost" (inventory_hostname = localhost) even when JBoss is DOWN. Am I doing anything wrong here?
tasks:
- name: Check JBOss java process
shell: ps -ef | grep java | grep "jboss.server"
register: jboss_java_process
ignore_errors: false
- debug: msg="JBoss Process is running on {{ inventory_hostname }}"
when: jboss_java_process.stdout.find("jboss.server") != -1
-SKR