Hey Jordan, 

Thanks for replying!
There were "`" missing, worked beautifully after that!

- set_fact:
      hosted_zone_id: "{{ dns_results | json_query('HostedZones[?Name==`' ~ 
hosted_zone_name ~ '.`].[Id]') | regex_replace('/hostedzone/', '') }}"

"~" escapes it, so there's no need to do a lookup, works nice

Thanks!

On Thursday, May 24, 2018 at 3:11:32 AM UTC+2, Jordan Borean wrote:
>
> Try this
>
> - set_fact:
>     hosted_zone_id: "{{ dns_results | json_query('HostedZones[?Name==' ~ 
> lookup('vars', hosted_zone_name) ~ '].[Id]') | 
> regex_replace('/hostedzone/', '') }}"
>
> You need to escape outside of the quoted arg of json_query and then run 
> the lookup. Note I haven't tested this
>
> Thanks
>
> Jordan
>

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7797e526-6149-4a39-8100-9bc1c772e8e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to