On Wed, 28 Aug 2019 08:35:23 -0700 (PDT) Cade Lambert <[email protected]> wrote:
> Ah, ok, I missed that those were backticks. So because we used
> double-quotes to encompass the whole argument, and single-quotes to
> encompass the json_query argument, we cannot use single-quotes again to
> encompass the search string. We need to use something else, in this case
> backticks, to distinguish the search string?
Right. It's possible to avoid them and declare a variable for this purpose.
- set_fact:
host_id: "{{ results|json_query(query) }}"
vars:
query: "[?name=='server2'].id"
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/20190828182503.2104e9ef%40gmail.com.
pgpd1crjYy4Fy.pgp
Description: OpenPGP digital signature
