yes i see two different dates because this.

my solution is:

in \tasks\main.yml put in line 2:

- include: set_facts.yml

in \tasks\set_facts.yml

- set_fact:  
   file_date: "{{ lookup('pipe','date +%Y-%m-%d-%H-%M-%S') }}"
   cacheable: true

that worked for me.

Thanx for your help


Am Dienstag, 28. August 2018 16:13:17 UTC+2 schrieb Brian Coca:
>
> To clarify, the reason you see 2 diff dates is because vars are 'lazy 
> evaluated' and evaluated for each task. 
>
> The solutions proposed above work because set_fact gets around this by 
> forcing evaluation and assigning the value. The registration takes the 
> 'backup_file' which is also a static value. 
>
>
>
> -- 
> ---------- 
> Brian Coca 
>

-- 
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/2a4ab0d6-be95-4c1e-9e95-a75781fb748d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to