On Thursday, 18 October 2018 19.54.12 CEST Dmitriy Panteleyev wrote:
> I was under the impression that if I define a variable with a `lookup`
> function, it would store the results of the lookup. And then when I used
> that variable, it would spit out the results of the lookup.
>
> However, from running a bunch of different test cases that Ansible performs
> the lookup every time I try to use that variable. Is that by design? Is
> there a way to avoid repeated lookups?
Yes, by design, but you can avoid it by using set_fact.
- set_fact:
myvar: '{{ lookup(...) }}'
--
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 [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/2300099.ZmQ3o09aWJ%40x1.
For more options, visit https://groups.google.com/d/optout.