On 08.03.2019 09:17, Vino Thiyagu wrote:
> HI Kai,
> 
> sorry for the late reply,
> 
> I have tried above one, still its not working to me. It gives the empty
> string in output.
> 
> 
> my playbook has below tasks:
>    register: test
> - debug:
>       msg: "{{test}}"
> - debug:
>       msg: "{{ test.results | selectattr('record.number','match','^CH$') |
> list }}

'^CH$' is only matching two characert that start with C and end with H aka CH,
so if you are trying to match something that start with CH you will need to 
remove the $.

-- 
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/29df2679-92b5-40ec-d0b4-8d22abdea580%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to