Thank you for the time.

I tried the Ipaddess parttern for my case. Also, tried the case suggested 
by you. But did not receive positive results.

Below is the snip of my code and the output respectively.

[image: 1..PNG]

[image: 2.PNG]



On Tuesday, May 7, 2019 at 10:12:55 PM UTC+5:30, Tharun Kumar wrote:
>
> You can use some thing like this.
>
> - set_fact:
>        Name: (result.stdout | from_json).name
>        Ipaddress: similar to the above
>
> On Tue, May 7, 2019 at 2:44 AM Aviya Singh <[email protected] 
> <javascript:>> wrote:
>
>> Hi,
>>
>> This was helpful.
>>
>> Meanwhile, I am trying to extract "PRETTY NAME" in a loop from below 
>> output. What should I use?
>>
>> [image: snip3.PNG]
>>
>>
>> Can you look into this ?
>>
>>
>> On Wednesday, March 19, 2014 at 10:17:35 AM UTC+5:30, Jinsik Kim wrote:
>>>
>>> Hi,
>>>
>>> I am a newbie in this wonderful tool Ansible.
>>> I made a playbook script to test it.
>>>
>>> But I found that sometimes I need to parse the stdout of each task.
>>>
>>> For instance
>>>
>>>  - name : run and get the result in JSON format on stdout
>>>    shell : "/usr/local/something"
>>>    register : result
>>>
>>>
>>> Let's see result.stdout
>>>
>>>  {u'name':u'test1', u'ipaddress':'xxx.xxx.xxx.xx', u'pass':'asdfasfd'}
>>>
>>> Can I extract these three elements(name, ipaddress, pass) from stdout 
>>> and use it on another task?
>>>
>>> I think lot of users experienced this issue because the return 
>>> values(stdout) of tools are not simple sometimes
>>>
>>> Even if I have a plan to make another Module I think it's tough because 
>>> I should pass the three elements.
>>> (Unfortunately I am not good at Python yet)
>>>
>>>
>>> Thanks in advance!
>>>
>>> -Justin
>>>
>>> -- 
>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/0e165dde-e93a-43bf-a62f-a1a4c0a9821d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/0e165dde-e93a-43bf-a62f-a1a4c0a9821d%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/064c4c3e-bea2-456c-8b92-062f5f890194%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to