Fortinet black logo

New Features

ADOM-level meta variables for general use in scripts, templates, and model devices

Copy Link
Copy Doc ID 722c6141-8e83-11ec-9fd1-fa163e15d75b:628021
Download PDF

ADOM-level meta variables for general use in scripts, templates, and model devices

In FortiManager, ADOM-level meta variables are available for general use in scripts, templates, and model devices.

To create and use an ADOM-level metadata variable:
  1. In FortiManager, enter the ADOM where the metadata variable will be used.
  2. Enable the metadata variable object type in Policy & Objects.
    1. Go to Policy & Objects, click Tools in the toolbar, and select Display Options.
    2. Enable the Metadata Variables object under the Advanced category, and click OK.
      Note

      In FortiManager 7.2.2 and later, Display Options has been renamed to Feature Visibility.

  3. Create the metadata variable object.
    1. In Policy & Objects, go to Object Configurations > Advanced > Metadata Variables, and click Create New.
      The Create New Metadata Variables wizard opens.
    2. Enter the required information to create the metadata variable.
      In this example, the following metadata information is used:
      • Name: hostname
      • Default Value: fgt-vm64
      • Per-Device Mapping: ON
      • Click OK to save your changes.
  4. Create a CLI template that includes the metadata variable.
    1. Go to Device Manager > Provisioning Templates > CLI Templates, and click Create New > Post-Run CLI Template.
      The Create Post-Run CLI Template wizard opens.
    2. Enter the script details, including the metavariable, and click OK.
      In this example, the following CLI is used that includes the hostname metadata variable:
      config system global
      set hostname $(hostname)
      end
  5. Install the CLI template to a device.
    1. Go to Device Manager and assign the template to a model device or an online FortiGate device.
    2. Perform an installation using the Install Wizard to install device settings.
      In this example, the CLI template is assigned and installed to FortiGate "vlan171_0072". When an installation is performed, the install preview shows that the variable (hostname) has been substituted as per its per-device value "Branch0072".

ADOM-level meta variables for general use in scripts, templates, and model devices

In FortiManager, ADOM-level meta variables are available for general use in scripts, templates, and model devices.

To create and use an ADOM-level metadata variable:
  1. In FortiManager, enter the ADOM where the metadata variable will be used.
  2. Enable the metadata variable object type in Policy & Objects.
    1. Go to Policy & Objects, click Tools in the toolbar, and select Display Options.
    2. Enable the Metadata Variables object under the Advanced category, and click OK.
      Note

      In FortiManager 7.2.2 and later, Display Options has been renamed to Feature Visibility.

  3. Create the metadata variable object.
    1. In Policy & Objects, go to Object Configurations > Advanced > Metadata Variables, and click Create New.
      The Create New Metadata Variables wizard opens.
    2. Enter the required information to create the metadata variable.
      In this example, the following metadata information is used:
      • Name: hostname
      • Default Value: fgt-vm64
      • Per-Device Mapping: ON
      • Click OK to save your changes.
  4. Create a CLI template that includes the metadata variable.
    1. Go to Device Manager > Provisioning Templates > CLI Templates, and click Create New > Post-Run CLI Template.
      The Create Post-Run CLI Template wizard opens.
    2. Enter the script details, including the metavariable, and click OK.
      In this example, the following CLI is used that includes the hostname metadata variable:
      config system global
      set hostname $(hostname)
      end
  5. Install the CLI template to a device.
    1. Go to Device Manager and assign the template to a model device or an online FortiGate device.
    2. Perform an installation using the Install Wizard to install device settings.
      In this example, the CLI template is assigned and installed to FortiGate "vlan171_0072". When an installation is performed, the install preview shows that the variable (hostname) has been substituted as per its per-device value "Branch0072".