template
Create files from templates.
Parameters for template
Parameter |
Type |
Comments |
|
|---|---|---|---|
path |
string |
Path to file. |
|
template |
dict |
Template parameters (see files-templates.yml) |
|
path |
string |
Path of the source file. |
|
force |
boolean |
If no, transfer if dest does not exist. |
|
… |
… |
<TBD> |
|
owner |
string |
Owner of the file. |
|
group |
string |
Group of the file. |
|
mode |
string |
Mode of the file. |
|
attributes |
string |
Attributes of the file. |
|
validate |
string |
Command to validate file. |
|
handlers |
list |
List of handlers. |
|
Example of template
File /etc/mail/mailer.conf for postfix
[contrib/postfix/conf-light/files.d/mailer-conf.yml]
1---
2mailerconf:
3 path: /etc/mail/mailer.conf
4 template:
5 path: mailer.conf.j2
6 force: true
7 owner: root
8 group: wheel
9 mode: "0644"
See also
See files-template.yml how the files are modified or created by the Ansible module
templateSee files-template.yml annotated source code
Note
There are couple of templates ready to be used in the directory
templates. The user is expected to create new templates when
needed. Feel free to contribute new templates to the project.