Perfect! Thanks.
On Monday, October 30, 2017 at 1:00:41 PM UTC+11, Pshem Kowalczyk wrote:
>
> You can move the actual query string to a separate variable to reduce some
> clutter and string concatenation. You can also use ` (backticks) to quote
> jmes_path strings:
>
> set_fact:
> enabled_ports: "{{ intfs | json_query(enabled)}}"
> vars:
> enabled: "values(@)[?is_enabled && is_up && vlan_tag == `{{
> mgmt_vlan }}`]"
>
> kind regards
> Pshem
>
>
> On Mon, 30 Oct 2017 at 13:55 Behrang Saeedzadeh <[email protected]
> <javascript:>> wrote:
>
>> Is there a cleaner alternative to:
>>
>> '{{ (things | json_query("[?name==''" + thing_name + "'']") }}'
>>
>> In particular, ideally I want to avoid:
>>
>> - String concatenation
>> - Escaping of quotes
>>
>> --
>> 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/e6e3df70-21f1-4fee-99da-b18de36727b2%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/ansible-project/e6e3df70-21f1-4fee-99da-b18de36727b2%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/184f2f49-a10f-4f17-ad08-201fd5418d9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.