ZPE Cloud Dynamic Template can be used to apply a dynamic
configuration/script to one or more devices. It can contain variables
which have different values depending on the device it is applied to.
Variables are defined under "Custom Fields" tab in ZPE Cloud Profiles section. The value of the custom field is related to the scope of the device based on the group it belongs to or the site it belongs to. Some custom fields can be targeted only to specific devices.
Example of adding custom field:
Templates are defined in "Profiles::Configuration". To create the dynamic template, select the Add option, ensure "Dynamic Template" checkbox is set and add a script/configuration using custom fields you have created previously. Below is a sample of dynamic template
- set /settings/network_connections/ETH1 ipv4_mode=static
set /settings/network_connections/ETH1 ipv4_address={{mt_eth1_address}}
set /settings/network_connections/ETH1 ipv4_bitmask={{mt_eth1_bitmask}}
commit
This template sets ETH1 interface with static IP. The value is looked up in the variable "mt_eth1_address" which is previously created in Custom Fields section. After the template is saved, you can apply to any device like any other profile.
To understand how the values will change, review this table:
If the dynamic template is applied to the device named MT-THERA, then mt_eth1_address=10.0.1.1, mt_eth1_bitmask=16. If the dynamic template is applied to device named MT-VESUVIUS, then mt_eth1_address=10.0.2.1, mt_eth1_bitmask=16.