I'm trying to figure out if there is a way to add a timestamp to the template file in Ansible so that every time I run the Ansible boot book that uses a specific template, it adds a playbook to the target file.
For example, I create a template configuration file using Ansible, and I want it to appear on the destination machine with a timestamp in the first line ...
eg.
cat something.conf_template
some config lines
After the templates:
- template: src=/mytemplates/something.conf_template dest=/etc/something.conf owner=smth group=smth mode=0644
content should be
cat something.conf
some config lines
Do you know any module that can do this?
source
share