- jinja2 CLI
pip install j2cli
- jq for pretty-printing
- Use your package manager (apt, yum, ...)
- Clone this repo
git clone https://github.com/sebbrochet/azure-jinja2.git
- Create a symbolic link in the directory where you plan to use the macro
cd my_template_dir
ln -s <just_cloned_directory> azure-jinja2
- Hack your ARM templates as shown in the examples directory...
- Generate your ARM template with your master jinja2 file (f.e azuredeploy.json.j2)
j2 azuredeploy.json.j2 > generated/azuredeploy.json
- You can pretty-print it with jq (keep order) or json.tool (order is lost)
j2 azuredeploy.json.j2 | jq . > generated/azuredeploy.json
j2 azuredeploy.json.j2 | python -m json.tool > generated/azuredeploy.json
- HTML documentation of all macros is in the docs directory
- You may find my ARM template checker useful to catch some errors before deploying your template on Azure...