Fortinet Document Library

Version:

Version:

Version:


Table of Contents

New Features

Download PDF
Copy Link

Interface template support for meta fields

When you create a meta field for a device object, a variable name is automatically created, and you can use the variable in interface templates when provisioning FortiGates.

When you create a meta field, you can specify whether it is required or optional. When the meta field is required for device objects, you must define a value for all FortiGate devices. A column is automatically displayed on the Device Manager pane to indicate required meta fields and to help you identify when values are missing.

After you assign interface templates to devices, you can view the post action values before you install the configuration to devices.

This topic includes the following sections:

Creating meta field variables

When you create a meta field, a variable name is automatically created, and you can set a value for the variable for each device.

This example describes how to create a meta field named storenumber for a device object. The storenumber meta field is set to Required. When a meta field is set to Required, a value must be defined for all devices. Set the meta field to Optional to avoid this requirement.

To create meta field variables:
  1. Go to System Settings > Advanced > Meta Fields, and click Create New.

    The Create New Meta Fields dialog box is displayed.

  2. In the Object list, select Device.
  3. In the Name box, type storenumber.
    Note

    The name identifies the meta field, and a variable name is automatically created for the meta field. View the Variable option to see the variable name that you can use in interface templates. For example, $(storenumber) is the variable name for the storenumber meta field.

  4. Beside Importance, select Required.
  5. Define the value:
    1. Under Values, click Create New.

      The Create Meta Field Value dialog box is displayed.

    2. In the Device list, select the device.
    3. In the Value box, type the store number.
    4. Click OK.

      The value is saved.

  6. Click OK.

    The meta field is created.

Using meta field variables in interface templates

You can use meta field variables in interface templates. When you create a meta field, a variable is automatically created for you. You can use the variable in interface templates.

To use meta field variables in interface templates:
  1. Go to Device Manager > Provisioning Templates.

    The widgets are displayed.

  2. Display the Interface widget.
    1. In the tree menu, go to System Templates > Default.
    2. From the Toggle Widgets menu, select Interface.

      The Interface widget is displayed.

  3. In the Interface widget, create a new Config Interface action that uses the storenumber variable.
    1. In the Interface widget, click +.
    2. In the Action list, select Config Interface.
    3. In the Model list, select all.
    4. In the Interface Name list, type port2.
    5. In the IP/Netmask box, type the variable with the IP/netmask, such as 192.162.$(storenumber).254/25, and click OK.

      Note that $(storenumber) is the variable name for the meta field.

      The action is created.

  4. In the Interface widget, create a new VLAN Interface action that uses the variable.
    1. In the Interface widget, click +.
    2. In the Action list, select Add VLAN Interface.
    3. In the Model list, select all.
    4. In the Physical Interface Name list, type port3.
    5. In the VLAN Name box, type the variable name, such as $(Address), and click OK.

      The action is created.

Viewing required meta fields in Device Manager

When a meta field is required for devices, you must assign an interface template to devices. If a device lacks a meta field value, a conflict symbol is displayed, and you cannot assign an interface template to it. You must define a value for the meta field for the device before you can assign an interface template to it.

To view required meta fields in Device Manager:
  1. Go to Device Manager > Device & Groups.
  2. In the tree menu, click Managed Devices.

    The managed devices are displayed in the content pane. A column is displayed for each required meta field. In the following example, a column for each of the following required meta fields is displayed: Address and storenumber.

    A conflict symbol is displayed for storenumber for one of the FortiGates, indicating that a value is not defined for the meta field for the device.

Assigning interface templates to devices

You must assign an interface template to devices when Required is enabled for certain meta fields.

You can also preview the meta field value.

To assign interface templates to devices:
  1. Go to Device Manager > Provisioning Templates, and select the template.
  2. In the content pane, expand This template is assigned to <number> devices.
  3. Click Assigned to Devices.
  4. In the Available Entries list, select the device, and click > to move it to the Selected Entries list. Click OK.

    The interface template is assigned to the device.

    When a FortiGate lacks a value for a meta field, a red conflict icon is displayed:

    When you try to assign the template, an error message is displayed:

  5. In the Interface widget, select the action, and click Post Action View.

    The Post Action Preview is displayed. The meta field displays the expected value.

  6. Click Cancel.

Overriding meta field values in interface templates

You can enable Allow Override in interface templates for some options. After you assign the interface template to a device, you can edit the interface action to override the option.

To override meta field values in interface templates:
  1. Go to Device Manager > Provisioning Templates, and select the template.
  2. Edit the interface template to allow overrides.
    1. In the Interface widget, select the action, and click Edit.
    2. Under the option, select Allow Override, and click OK.

      Overrides are allowed for the option.

  3. Override the value.
    1. Under This template is assigned to <number> devices widget, select the device, and click Edit Widget Override Value.

      The Edit Action dialog box is displayed.

    2. Type the override value, and click OK.
  4. Install the configuration to the device.

    The override value is installed to the device.

Interface template support for meta fields

When you create a meta field for a device object, a variable name is automatically created, and you can use the variable in interface templates when provisioning FortiGates.

When you create a meta field, you can specify whether it is required or optional. When the meta field is required for device objects, you must define a value for all FortiGate devices. A column is automatically displayed on the Device Manager pane to indicate required meta fields and to help you identify when values are missing.

After you assign interface templates to devices, you can view the post action values before you install the configuration to devices.

This topic includes the following sections:

Creating meta field variables

When you create a meta field, a variable name is automatically created, and you can set a value for the variable for each device.

This example describes how to create a meta field named storenumber for a device object. The storenumber meta field is set to Required. When a meta field is set to Required, a value must be defined for all devices. Set the meta field to Optional to avoid this requirement.

To create meta field variables:
  1. Go to System Settings > Advanced > Meta Fields, and click Create New.

    The Create New Meta Fields dialog box is displayed.

  2. In the Object list, select Device.
  3. In the Name box, type storenumber.
    Note

    The name identifies the meta field, and a variable name is automatically created for the meta field. View the Variable option to see the variable name that you can use in interface templates. For example, $(storenumber) is the variable name for the storenumber meta field.

  4. Beside Importance, select Required.
  5. Define the value:
    1. Under Values, click Create New.

      The Create Meta Field Value dialog box is displayed.

    2. In the Device list, select the device.
    3. In the Value box, type the store number.
    4. Click OK.

      The value is saved.

  6. Click OK.

    The meta field is created.

Using meta field variables in interface templates

You can use meta field variables in interface templates. When you create a meta field, a variable is automatically created for you. You can use the variable in interface templates.

To use meta field variables in interface templates:
  1. Go to Device Manager > Provisioning Templates.

    The widgets are displayed.

  2. Display the Interface widget.
    1. In the tree menu, go to System Templates > Default.
    2. From the Toggle Widgets menu, select Interface.

      The Interface widget is displayed.

  3. In the Interface widget, create a new Config Interface action that uses the storenumber variable.
    1. In the Interface widget, click +.
    2. In the Action list, select Config Interface.
    3. In the Model list, select all.
    4. In the Interface Name list, type port2.
    5. In the IP/Netmask box, type the variable with the IP/netmask, such as 192.162.$(storenumber).254/25, and click OK.

      Note that $(storenumber) is the variable name for the meta field.

      The action is created.

  4. In the Interface widget, create a new VLAN Interface action that uses the variable.
    1. In the Interface widget, click +.
    2. In the Action list, select Add VLAN Interface.
    3. In the Model list, select all.
    4. In the Physical Interface Name list, type port3.
    5. In the VLAN Name box, type the variable name, such as $(Address), and click OK.

      The action is created.

Viewing required meta fields in Device Manager

When a meta field is required for devices, you must assign an interface template to devices. If a device lacks a meta field value, a conflict symbol is displayed, and you cannot assign an interface template to it. You must define a value for the meta field for the device before you can assign an interface template to it.

To view required meta fields in Device Manager:
  1. Go to Device Manager > Device & Groups.
  2. In the tree menu, click Managed Devices.

    The managed devices are displayed in the content pane. A column is displayed for each required meta field. In the following example, a column for each of the following required meta fields is displayed: Address and storenumber.

    A conflict symbol is displayed for storenumber for one of the FortiGates, indicating that a value is not defined for the meta field for the device.

Assigning interface templates to devices

You must assign an interface template to devices when Required is enabled for certain meta fields.

You can also preview the meta field value.

To assign interface templates to devices:
  1. Go to Device Manager > Provisioning Templates, and select the template.
  2. In the content pane, expand This template is assigned to <number> devices.
  3. Click Assigned to Devices.
  4. In the Available Entries list, select the device, and click > to move it to the Selected Entries list. Click OK.

    The interface template is assigned to the device.

    When a FortiGate lacks a value for a meta field, a red conflict icon is displayed:

    When you try to assign the template, an error message is displayed:

  5. In the Interface widget, select the action, and click Post Action View.

    The Post Action Preview is displayed. The meta field displays the expected value.

  6. Click Cancel.

Overriding meta field values in interface templates

You can enable Allow Override in interface templates for some options. After you assign the interface template to a device, you can edit the interface action to override the option.

To override meta field values in interface templates:
  1. Go to Device Manager > Provisioning Templates, and select the template.
  2. Edit the interface template to allow overrides.
    1. In the Interface widget, select the action, and click Edit.
    2. Under the option, select Allow Override, and click OK.

      Overrides are allowed for the option.

  3. Override the value.
    1. Under This template is assigned to <number> devices widget, select the device, and click Edit Widget Override Value.

      The Edit Action dialog box is displayed.

    2. Type the override value, and click OK.
  4. Install the configuration to the device.

    The override value is installed to the device.