Ansible nested variable regex search

12 views
Skip to first unread message

Srikanth Ethiraj

unread,
May 9, 2019, 1:03:40 PM5/9/19
to Ansible Project

How do we do a wildcard search with ansible nested variable?


test:
  name:
    address:
         zipcode: 12345


Ansible nested variable -

{{ test[name][addre*].zipcode }}







Dick Visser

unread,
May 10, 2019, 6:23:22 AM5/10/19
to ansible...@googlegroups.com
You can't use glob characters for keys.
Use the json query filter instead:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#json-query-filter
> --
> 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 ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2348d031-e3d1-4f6e-8a68-54bdce7e4161%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT
Reply all
Reply to author
Forward
0 new messages