On Monday, 21 January 2019 10:08:31 CET Vino Thiyagu wrote:
> HI team,
> 
> I have a output as below. but still I need to pick the right value fro this 
> output. I need only the change no as in record field, it working fine for 
> single run but it failing when in loop. can some one help me. needed filed 
> in "number": "CHG0030428",  I will have multiple change no through out the 
> debug module.
> I tried with selectattr and map to it was not working
> 
> msg: "{{test.results.record| selectattr('number','match','^CH$')}}"
> and 
> msg: "{{test.record| selectattr('number','match','^CH$')|list}}"
> 
> msg: "{{test.results.record| selectattr('number','match','^CH$')}}"

I don't understand what you are searching for but, to match in the number you 
need to user this

{{ test.results | selectattr('record.number','match','^CH$') | list }}


-- 
Kai Stian Olstad


-- 
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/1579830.tRaEPDsm01%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to