cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
577
Views
0
Helpful
3
Replies

Set tailf:cli-reset-siblings values using a config-template

mikeg22
Level 1
Level 1

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?

 

1 Accepted Solution

Accepted Solutions

mikeg22
Level 1
Level 1

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.

View solution in original post

3 Replies 3

hniska
Cisco Employee
Cisco Employee

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

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;
+       }
+     }

 

mikeg22
Level 1
Level 1

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.