On 10.06.2019 22:11, Gregory Skelton wrote:
> Hello Everyone,
> 
> I'm trying to reference a complex variable, but one of the words has a
> hyphen which breaks things.

Breaks what? With [] notation hyphen is allowed.


> Is there a way to set a fact the "specificVar" value from the last line in
> 1 set_fact statement?
> So right now I've split up the setting the vars into two different set_fact
> statements
> 
> set_fact:
>      intermediate_var: "{{ example_text['json']['output-parameters'] }}"
> set_fact:
>      machine_var: "{{ intermediate_var[0].value.string.value }}"

Do what you have done

{{ example_text['json']['output-parameters'][0].value.string.value }}


-- 
Kai Stian Olstad

-- 
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/e85b1ae8-1fa5-0a6d-25cf-cc6db7cd2491%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to