Re: [ansible-project] Is there a cleaner alternative to '{{ (things | json_query("[?name==''" + thing_name + "'']") }}'

2017-10-30 Thread Behrang Saeedzadeh
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: >

Re: [ansible-project] Is there a cleaner alternative to '{{ (things | json_query("[?name==''" + thing_name + "'']") }}'

2017-10-29 Thread Pshem Kowalczyk
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

[ansible-project] Is there a cleaner alternative to '{{ (things | json_query("[?name==''" + thing_name + "'']") }}'

2017-10-29 Thread Behrang Saeedzadeh
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"