Ansible managed in file copy

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

​You want to use template for that :)​

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

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

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

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.