04-10-2023 10:55 AM
YANG values with tailf:cli-reset-siblings require mutliple values be set in the same "pass". A device-template will do so. For example:
admin@7ccbd23a9e56(config)# devices template set_radius_server_ipv4_ports ned-id cisco-ios-cli-6.84 config
admin@7ccbd23a9e56(config-config)# radius server TEST address ipv4 auth-port 1234 acct-port 5678
admin@7ccbd23a9e56(config-server-TEST)# commit
Commit complete.
admin@7ccbd23a9e56(config-server-TEST)# top
admin@7ccbd23a9e56(config)# devices device functional-gns3-sw1 apply-template template-name set_radius_server_ipv4_ports | debug template
Operation 'merge' on existing node: /devices/device[name='functional-gns3-sw1']
Fetching literal "TEST"
Operation 'merge' on non-existing node: /devices/device[name='functional-gns3-sw1']/config/ios:radius/server[id='TEST']
Operation 'merge' on non-existing node: /devices/device[name='functional-gns3-sw1']/config/ios:radius/server[id='TEST']/address/ipv4/auth-port
Fetching literal "1234"
Setting /devices/device[name='functional-gns3-sw1']/config/ios:radius/server[id='TEST']/address/ipv4/auth-port to "1234"
Operation 'merge' on non-existing node: /devices/device[name='functional-gns3-sw1']/config/ios:radius/server[id='TEST']/address/ipv4/acct-port
Fetching literal "5678"
Setting /devices/device[name='functional-gns3-sw1']/config/ios:radius/server[id='TEST']/address/ipv4/acct-port to "5678"
apply-template-result {
device functional-gns3-sw1
result ok
}
admin@7ccbd23a9e56(config)# commit dry-run
cli {
local-node {
data devices {
device functional-gns3-sw1 {
config {
radius {
+ server TEST {
+ address {
+ ipv4 {
+ auth-port 1234;
+ acct-port 5678;
+ }
+ }
+ }
}
}
}
}
}
}
admin@7ccbd23a9e56(config)# commit dry-run outformat xml
result-xml {
local-node {
data <devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name>functional-gns3-sw1</name>
<config>
<radius xmlns="urn:ios">
<server>
<id>TEST</id>
<address>
<ipv4>
<auth-port>1234</auth-port>
<acct-port>5678</acct-port>
</ipv4>
</address>
</server>
</radius>
</config>
</device>
</devices>
}
}
But applying the above XML in a config-template only sets acct-port:
+ server TEST_SERVER {
+ address {
+ ipv4 {
+ host ###.###.2.62;
+ acct-port 1813;
+ }
+ }
How can I set multiple values with an XML config-template when the value's YANG has tailf:cli-reset-siblings?
Solved! Go to Solution.
04-24-2023 04:49 AM
My understanding of tailf:cli-reset-siblings was incomplete and I misdiagnosed the cause of my config-template problem. A better understanding of tailf:cli-sequence-commands/tailf:cli-reset-siblings (provided by a Cisco Engineer) allowed me to find and fix the root cause of my issue.
A config-template can set tailf:cli-reset-siblings values. My template uses XPaths for the acct/auth-port values and I inadvertantly reset auth-port by not knowing the tailf:cli-sequence-commands/tailf:cli-reset-siblings requirements.
04-11-2023 08:46 PM
You also need to set the host part
Juniper cli
set devices device ce0 config radius server test address ipv4 acct-port 1234 auth-port 3214 host 192.168.1.1
Cisco cli
admin@ncs(config)# show full-configuration devices device ce0 config radius
devices device ce0
config
radius server test
address ipv4 192.168.1.1 auth-port 3214 acct-port 1234
04-12-2023 01:28 PM
hniska, thank you for replying! I am getting the same behavior while specifying the host:
admin@7ccbd23a9e56(config)# devices template set_radius_server_ipv4_ports ned-id cisco-ios-cli-6.84 config
admin@7ccbd23a9e56(config-config)# radius server TEST address ipv4 host ###.###.4.62 auth-port 1234 acct-port 5678
admin@7ccbd23a9e56(config-server-TEST)# commit
Commit complete.
admin@7ccbd23a9e56(config-server-TEST)# top
admin@7ccbd23a9e56(config)# devices device functional-gns3-sw1 apply-template template-name set_radius_server_ipv4_ports | debug template
Operation 'merge' on existing node: /devices/device[name='functional-gns3-sw1']
Fetching literal "TEST"
Operation 'merge' on non-existing node: /devices/device[name='functional-gns3-sw1']/config/ios:radius/server[id='TEST']
Operation 'merge' on non-existing node: /devices/device[name='functional-gns3-sw1']/config/ios:radius/server[id='TEST']/address/ipv4/host
Fetching literal "###.###.4.62"
Setting /devices/device[name='functional-gns3-sw1']/config/ios:radius/server[id='TEST']/address/ipv4/host to "###.###.4.62"
Operation 'merge' on non-existing node: /devices/device[name='functional-gns3-sw1']/config/ios:radius/server[id='TEST']/address/ipv4/auth-port
Fetching literal "1234"
Setting /devices/device[name='functional-gns3-sw1']/config/ios:radius/server[id='TEST']/address/ipv4/auth-port to "1234"
Operation 'merge' on non-existing node: /devices/device[name='functional-gns3-sw1']/config/ios:radius/server[id='TEST']/address/ipv4/acct-port
Fetching literal "5678"
Setting /devices/device[name='functional-gns3-sw1']/config/ios:radius/server[id='TEST']/address/ipv4/acct-port to "5678"
apply-template-result {
device functional-gns3-sw1
result ok
}
admin@7ccbd23a9e56(config)# commit dry-run
cli {
local-node {
data devices {
device functional-gns3-sw1 {
config {
radius {
+ server TEST {
+ address {
+ ipv4 {
+ host ###.###.4.62;
+ auth-port 1234;
+ acct-port 5678;
+ }
+ }
+ }
}
}
}
}
}
}
admin@7ccbd23a9e56(config)# commit dry-run outformat xml
result-xml {
local-node {
data <devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name>functional-gns3-sw1</name>
<config>
<radius xmlns="urn:ios">
<server>
<id>TEST</id>
<address>
<ipv4>
<host>###.###.4.62</host>
<auth-port>1234</auth-port>
<acct-port>5678</acct-port>
</ipv4>
</address>
</server>
</radius>
</config>
</device>
</devices>
}
}
+ server TEST_SERVER {
+ address {
+ ipv4 {
+ host ###.###.2.62;
+ acct-port 1813;
+ }
+ }
04-24-2023 04:49 AM
My understanding of tailf:cli-reset-siblings was incomplete and I misdiagnosed the cause of my config-template problem. A better understanding of tailf:cli-sequence-commands/tailf:cli-reset-siblings (provided by a Cisco Engineer) allowed me to find and fix the root cause of my issue.
A config-template can set tailf:cli-reset-siblings values. My template uses XPaths for the acct/auth-port values and I inadvertantly reset auth-port by not knowing the tailf:cli-sequence-commands/tailf:cli-reset-siblings requirements.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide