Actually, example without lookup at all:
- name: Test random
set_fact:
rand_result: "{{ 5 | random }}"
until: rand_result == 'NEVER'
retries: 10
delay: 1
If I run ansible in verbose mode I see that on all iterations rand_result
var have the same value, so jinja template evaluated once.
How can I force reevaluate it on every iteration?
чт, 18 окт. 2018 г. в 10:32, Pavel Martynov <[email protected]>:
> Hi!
>
> I want to wait for some DNS record registered in DNS server. For example,
> A record. So I try to use this task:
>
> - name: Wait DNS A record host.example.com registered
> set_fact:
> lookup_result: "{{ lookup('dig', 'host.example.com.') }}"
> until: lookup_result != 'NXDOMAIN'
> retries: 20
> delay: 3
>
> But looks like lookup runs only single time at start and never again. I
> checked it with tcpdump:
> $ sudo tcpdump udp port 53
>
> Only single request/response on first loop iteration.
> So, looks like lookup_result setted to value 'NXDOMAIN' and this value
> checked with effectively "until: 'NXDOMAIN' != 'NXDOMAIN'" 20 times without
> success.
>
> How can I force run lookup on every loop iteration?
>
> Ansible version 2.6.5
>
> Thanks.
>
> --
> 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/2ad1ad66-57d4-4029-8aac-e067205e3d2c%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/2ad1ad66-57d4-4029-8aac-e067205e3d2c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
with best regards, Pavel Martynov
--
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/CAOHFFGQZwy6C%3DTQyazsYBS2oT2v-bn3bUR%3DvXPft0_3NeJYCOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.