stdout return 2 values

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.

What are you actually trying to achieve?
Because from your shell task it seems you intend to do things that could be better done in other ways