# Ansible managed in file copy

**URL:** <https://forum.ansible.com/t/ansible-managed-in-file-copy/13510>\
**Category:** Ansible Project\
**Created:** [September 20, 2013, 8:55am UTC](https://forum.ansible.com/t/ansible-managed-in-file-copy/13510 "2013-09-20T08:55:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vincent\_Van\_der\_Kuss](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@Vincent\_Van\_der\_Kuss](https://forum.ansible.com/u/Vincent_Van_der_Kuss)\
**Post date:** [September 20, 2013, 8:55am UTC](https://forum.ansible.com/t/ansible-managed-in-file-copy/13510/1 "2013-09-20T08:55:30Z")

</div>

Hi,

I don’t think this is possible, but it would be nice if it was.

Is it possible to use the {{ ansible\_managed }} with a regular file (no template)?  
Sometimes you don’t need a template because the content is static, but it would  
be nice to have a line in the file to say that it is managed by Ansible and can/will be  
overwritten on a next run.

\_Vincent

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [September 20, 2013, 8:58am UTC](https://forum.ansible.com/t/ansible-managed-in-file-copy/13510/2 "2013-09-20T08:58:21Z")

</div>

​You want to use template for that :)​

---

<div class="post-metadata">

**Author:** ![Vincent\_Van\_der\_Kuss](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@Vincent\_Van\_der\_Kuss](https://forum.ansible.com/u/Vincent_Van_der_Kuss)\
**Post date:** [September 20, 2013, 9:03am UTC](https://forum.ansible.com/t/ansible-managed-in-file-copy/13510/3 "2013-09-20T09:03:10Z")

</div>

Probably, I was thinking a little further.

If you for example use the sysctl (or any other module that changes files) module, it owuld be nice to have the same functionality.

Basicly an option like mark\_managed=yes that you could add to the action.

Just an idea

\_Vincent

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [September 20, 2013, 4:04pm UTC](https://forum.ansible.com/t/ansible-managed-in-file-copy/13510/4 "2013-09-20T16:04:56Z")

</div>

I’m using ansible\_managed with xattr module, keeps it from ‘clouding’ the md5 of the file.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [September 21, 2013, 1:07pm UTC](https://forum.ansible.com/t/ansible-managed-in-file-copy/13510/5 "2013-09-21T13:07:54Z")

</div>

That seems strange seeing that attribute is generated by the template module. do you mean it requires an action plugin?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [September 23, 2013, 7:43pm UTC](https://forum.ansible.com/t/ansible-managed-in-file-copy/13510/6 "2013-09-23T19:43:38Z")

</div>

no, i just define ansible\_managed in my inventory using $PIPE to set the  
date as I had been using this before the feature was added to template.
