I have what seems to be a simple question that I can't find on the web.  How do 
I get the current date from the Ansible server into a J2 variable?  I know how 
to do it with {{ ansible_date_time.date }} but that's from the remote node at 
the time Ansible collected facts (which could be cached), NOT "now" on the 
server I'm running on...right?

Use case (this works, but it's remote node "setup" (get facts) time, not local 
server "now" time):
 - name: Update image_release file
   lineinfile:
     dest=..../image_release
     state=present
     insertbefore=BOF
     line='{{ ansible_date_time.date }} {{ image_release }}'
How do I get "now" on the server I'm running on?

-- 
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/73b10bf5-a9f9-4525-9f75-8dd37bb7a04e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to