Add interfaces and vlans methods to Qtech model; update TTP template
- Implemented the `interfaces` method to process IP addresses and netmasks, adding a calculated mask to the output. - Added the `vlans` method to handle VLAN data, supporting both individual and grouped VLAN IDs. - Updated the QTECH TTP template to include a new version field and improved formatting for VLAN definitions.
This commit is contained in:
@@ -3,22 +3,25 @@
|
||||
<vars>
|
||||
default_system = {
|
||||
"model": "",
|
||||
"serial_number": ""
|
||||
"serial_number": "",
|
||||
"version": ""
|
||||
}
|
||||
</vars>
|
||||
|
||||
<group name="system">
|
||||
! {{ model }} Series Software, Version {{ bootrom_ver }} Build {{ version }}, {{ ignore }}
|
||||
! Serial num:{{ serial_number }}, {{ ignore }}
|
||||
<group name="system" default="default_system">
|
||||
! {{ model | ORPHRASE }} Series Software, Version {{ ignore }} Build {{ version | strip(",") }}{{ ignore('.*') }}
|
||||
! Serial num:{{ serial_number | strip(",") }}{{ ignore('.*') }}
|
||||
</group>
|
||||
|
||||
<group name="interfaces">
|
||||
interface {{ interface }}
|
||||
description {{ description | ORPHRASE }}
|
||||
ip address {{ ip_address }} {{ netmask }}
|
||||
description {{ description | ORPHRASE }}
|
||||
ip address {{ ip_address }} {{ netmask }}
|
||||
</group>
|
||||
|
||||
<group name="vlans">
|
||||
vlan {{ vlan_id }}
|
||||
name {{ name }}
|
||||
vlan {{ vlan_ids | contains(",", "-") | unrange("-", ",") | _start_ }}
|
||||
,{{ vlan_tail | unrange("-", ",") }}
|
||||
vlan {{ vlan_id | _start_ }}
|
||||
name {{ name | ORPHRASE }}
|
||||
</group>
|
||||
|
||||
Reference in New Issue
Block a user