I am running shell script via playbook
- name: Get status of Filebeat
shell: sh /path/get_status.sh "status"
when: action == "status"
my shell script is get_status.sh
SERVICE="filebeat"
if pgrep -x "$SERVICE" >/dev/null
then
echo "$SERVICE is running"
else
echo "$SERVICE is stopped"
I want this echo statement of shell script to be on ansible output, how can I do?