Hi
I try to get PID using Ansible.
I try run the following lines but instead to get one value (PID) I get 2 values , 1 - PID and 2 - PID of Ansible process that running remotely.
I get: "pid.stdout": "2229\n2456601"
that actually 2229 value I need to store as pid.
---
- name: Gen Tread
hosts: all
gather_facts: true
tasks:
- name: get PID.
shell: "ps aux | grep -i jira | grep -i java | awk -F '[ ]*' '{print $2}' "
register: pid
- debug:
var: pid.stdout
Please assist