Templator is a tool to generate any type of file (configuration file, terraform files, salt files, puppet files, anything you want) with input defined in a yaml file.
This is a Symfony project.
Please use the installation guide from Symfony
In short:
$ composer install
Any type of file can be generated.
Place a file in templates/jinja//.. This is the template file. Use twig (jinja) syntax for your template.
Create a file in templates/configs//.yaml . and must be identical to the template.
The first level on the yaml file is vars
.
The second level is each twig variable declared in the template.
The third levels are :
type
. The variable types. This field is mandatory. Currently supported types are :- int
- string
- select
- password
default
. The default value for the variable.- For
select
type,values
is mandatory. It contains the possible choices. - The types
select
,int
andstring
can have ahelp
field that will be displayed as a description below the text input. - The type
string
can be set optional by setting the attributerequired
tofalse
.
Example :
vars:
a_string:
type: string
default: "default string value"
an_int:
type: int
default: 3.14
help: "This is a number"
a_choice:
type: select
values:
- yes
- no
- maybe
a_password:
type: password
default: ""
comment:
type: string
default: ""
required: false
help: "this is a comment you can add"
Images: Github image provided by http://tholman.com/github-corners/