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