Configuration Template
Configuration templates provide a powerful way to define reusable configuration blocks that can be applied to multiple device groups with different variable values. This is particularly useful for service-related configurations that need to be deployed repeatedly across different devices or environments with slight variations.
Configuration templates work by:
- Defining a template with parameterized values using
${variable_name}
syntax - Applying the template to device groups via the
configuration_templates
attribute - Using device group or global variables to populate the template parameters
This approach promotes configuration consistency, reduces duplication, and simplifies management of similar services across your network infrastructure.
Diagram
Classes
configuration_templates (iosxe)
Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
name | String | Yes |
Examples
iosxe: configuration_templates: - name: vlan_service configuration: vlan: vlans: - id: ${vlan_id} name: ${vlan_name} interfaces: vlans: - id: ${vlan_id} description: "SVI for ${vlan_name}" ipv4: address: ${svi_ip} address_mask: 255.255.255.0
device_groups: - name: dmz_vlan configuration_templates: [vlan_service] variables: vlan_id: 100 vlan_name: "DMZ" svi_ip: "192.168.100.1" - name: guest_vlan configuration_templates: [vlan_service] variables: vlan_id: 200 vlan_name: "Guest" svi_ip: "192.168.200.1"