cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
103
Views
0
Helpful
1
Replies

Help with #INTERACTIVE section of template for setting VTP Primary

DJW487
Level 1
Level 1

I am trying to write a template that sets the switch VTP mode 3, configures domain and password and then depending if the hostname contains core or distro, sets the mode to server, and if it's core to also set to primary server.

For the core, via cli this would be done like :

conf t

vtp domain xxxx

vtp password yyyy

vtp ver 3

vtp mode server

exit

vtp primary

(then there is a prompt:)

DJW487_0-1750910021271.png

This system is becoming primary server for feature vlan
No conflicting VTP3 devices found.
Do you want to continue? [confirm]

(hit enter after the prompt)

I am using jinja templates, and it's easy enough to do the first lot of commands, but the enable mode command is tricky as it has a multiline question and the answer is just to hit enter.
From what I gather it's going to be an #IINTERACTIVE inside a #MODE_ENABLE like this.

#MODE_ENABLE
#INTERACTIVE
vtp primary<IQ>This system is becoming primary server for feature vlan
No conflicting VTP3 devices found.
<R> ...something goes here to send and enter...
#ENDS_INTERACTIVE
#MODE_END_ENABLE

I can't work out how to get it firstly to recognise multiline prompt (if it even needs to? Or does it just need to see the last line 'Do you want to continue? [confirm]' and secondly how to tell it to just sent an 'enter/return'?

1 Reply 1

Roger Moore Jr
Cisco Employee
Cisco Employee

Since it doesn't require a response, try using this with no response text:

#MODE_ENABLE
#INTERACTIVE
vtp primary<IQ>Do you want to continue<R>

#ENDS_INTERACTIVE
#MODE_END_ENABLE

Here's the reference:

https://www.cisco.com/c/en/us/td/docs/cloud-systems-management/network-automation-and-management/dna-center/2-3-7/user_guide/b_cisco_dna_center_ug_2_3_7/b_cisco_dna_center_ug_2_3_7_chapter_01000.html?bookSearch=true