# template\_run\_date to be Idempotent

**URL:** <https://forum.ansible.com/t/template-run-date-to-be-idempotent/26330>\
**Category:** Ansible Developer\
**Created:** [December 19, 2017, 2:10pm UTC](https://forum.ansible.com/t/template-run-date-to-be-idempotent/26330 "2017-12-19T14:10:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hudec\_Peter](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@Hudec\_Peter](https://forum.ansible.com/u/Hudec_Peter)\
**Post date:** [December 19, 2017, 2:10pm UTC](https://forum.ansible.com/t/template-run-date-to-be-idempotent/26330/1 "2017-12-19T14:10:30Z")

</div>

Hi,

I used the \*\*template\_run\_date\*\* in one template, but this breaks my  
tests. The task is not idempotent.

I did not found, how the \*\*ansible\_managed\*\* works, that is idempotent,  
my setup is like

ansible\_managed = This file is managed by Ansible.%n  
&nbsp;&nbsp;template: {file}  
&nbsp;&nbsp;date: %Y-%m-%d %H:%M:%S  
&nbsp;&nbsp;user: {uid}  
&nbsp;&nbsp;host: {host}

Is there a way how to put the date of the generation into the file and  
be idempotent when nothing else would change?

&nbsp;&nbsp;thanks  
&nbsp;&nbsp;&nbsp;&nbsp;Peter
