If you're using ansible 2.0, now you can use "{{lookup('pipe', 'date 
+%Y%m%d%H%M%S')}}" to get what you want.

On Thursday, April 23, 2015 at 12:03:00 AM UTC+8, rambius wrote:
>
> Hello,
>
> I defined a timestamp variable used to name backup files:
>
> backup_timestamp: "{{ ansible_date_time.year }}{{ ansible_date_time.month 
> }}{{ ansible_date_time.day }}{{ ansible_date_time.hour }}{{ 
> ansible_date_time.minute }}{{ ansible_date_time.second }}"
>
> I use that variable successfully in a command. My questions is: is there a 
> way to define timestamp formats without manual appending of 
> ansible_data_time's components?
>
> Regards
> rambius
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/43e94df7-872e-4094-99d7-13edbf590e76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to