Fortinet black logo
7.0.0

Jinja templates

Jinja templates

To configure Underlay, Overlay, and Routing pillars, we will mostly use the new Jinja Template engine integrated into FMG 7.0.x.

Although this is just one of the available kinds of the provisioning templates, it deserves a separate section.

With Jinja templates, you can describe your project in a human-readable declarative (also considered implementation-agnostic) language and create what we will refer to as a Project template written in Jinja. Next, this Project template will be used by a set of Jinja CLI Templates to generate the necessary FortiOS (FOS) configuration.

Although these Jinja CLI Templates can be written from scratch, we provide a ready-to-use set of templates, producing our best practice configuration for SD-WAN deployments. In this document we will demonstrate its use.

Note

The latest version of the templates can be found in our dedicated GitHub repository. See Appendix B - External resources.

Note

Any plain text editor can be used to view and edit Jinja templates. Many editors conveniently provide syntax highlighting. Here are some popular editors to consider:

  • Atom (https://atom.io/) is available on macOS, Windows, and Linux.
  • Visual Studio Code (https://code.visualstudio.com/) is available on macOS, Windows, and Linux.
  • Notepad++ (https://notepad-plus-plus.org/) is available on Windows.

Jinja templates

To configure Underlay, Overlay, and Routing pillars, we will mostly use the new Jinja Template engine integrated into FMG 7.0.x.

Although this is just one of the available kinds of the provisioning templates, it deserves a separate section.

With Jinja templates, you can describe your project in a human-readable declarative (also considered implementation-agnostic) language and create what we will refer to as a Project template written in Jinja. Next, this Project template will be used by a set of Jinja CLI Templates to generate the necessary FortiOS (FOS) configuration.

Although these Jinja CLI Templates can be written from scratch, we provide a ready-to-use set of templates, producing our best practice configuration for SD-WAN deployments. In this document we will demonstrate its use.

Note

The latest version of the templates can be found in our dedicated GitHub repository. See Appendix B - External resources.

Note

Any plain text editor can be used to view and edit Jinja templates. Many editors conveniently provide syntax highlighting. Here are some popular editors to consider:

  • Atom (https://atom.io/) is available on macOS, Windows, and Linux.
  • Visual Studio Code (https://code.visualstudio.com/) is available on macOS, Windows, and Linux.
  • Notepad++ (https://notepad-plus-plus.org/) is available on Windows.