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 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b929ec49-a549-474d-a676-a2a9d47f04fen%40googlegroups.com.

Reply via email to