Jinja CLI templates
Following is a summary of the tasks to complete in Device Manager:
- Import Jinja CLI templates. See Importing Jinja CLI templates.
- Create CLI template groups. See Creating CLI template groups.
- Assign CLI template groups to device groups. See Assigning CLI template groups.
Importing Jinja CLI templates
Import the Project
template file first, and then import the remaining templates. The Project
template file is imported first because all the other templates use it, so the Project
template file must exist in FortiManager before we import the other templates.
When you import CLI templates that use meta fields, FortiManager prompts you to create the meta fields.
To import Jinja CLI templates:
- In Device Manager, go to Provisioning Templates > CLI Templates.
- From the More menu, select Import.
- Drag and drop the Project template file on the Import CLI Template pane.
Ensure that you import the Project template file first. Because all the other templates use the Project template, it must exist in FortiManager before you import the other templates.
- Set Script Type to Jinja Script, and click Import:
FortiManager automatically suggests that you create all the necessary meta fields.
- Create the necessary meta fields. Ensure that you create them all as optional Device meta fields:
- Click Import again. The import succeeds.
- Import all the other templates in our set.
Pay special attention to the pre-run CLI templates because they must be marked explicitly.
It is also important to set Script Type to Jinja Script for all the files:
- FortiManager will suggest creating additional meta fields (including
profile
andregion
).As before, make sure to create them all as optional Device meta fields:
- Click Import again, and make sure the import succeeds.
Creating CLI template groups
To create CLI template groups:
- On the Provisioning Templates > CLI Templates pane, click Create New > CLI Template Group, and create two template groups named Edge-Template and Hub-Template:
For example, create the Edge-Template group, and select the following members:
- 01-Edge-Underlay
- 02-Edge-Overlay
- 03-Edge-Routing
For example, create the Hub-Template group, and select the following members
- 01-Hub-Underlay
- 02-Hub-Overlay
- 03-Hub-Routing
- 04-Hub-MultiRegion
Assigning CLI template groups
The generic CLI template groups will be applied to all types of sites.
To assign CLI template groups:
- On the Provisioning Templates > CLI Templates pane, click Assign to Device/Group to assign the CLI template groups to the device groups named Edge and Hubs respectively: