06-12-2017 05:06 AM - edited 03-01-2019 03:51 AM
I wonder if there is a way to annotate configuration commands in service xml template.
For instance, our current configuration for Juniper static routes are annotated to include
customer name information and we would like to maintain that:
/* AS65535 Example.com loopback */
route 10.0.0.1/32 next-hop 196.254.0.1;
´
I know you can do it from ncs_cli command line like this:
ncs_cli> annotate device device juniper1 config junos:configuration routing-options route 10.0.0.1/32 "AS65535 Example.com loopback"
08-09-2017 03:10 PM
You'll need to capture the annotation string in a variable (say DESCRIPTION) and then map it to your XML template.
Please adapt the following example to match your needs:
<config xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name>{$DEVICE}</name>
<config>
<interface xmlns="urn:ios">
<Loopback annotation="{$DESCRIPTION}">
<name>0</name>
<ip>
<address>
<primary>
<address>{$IPADDRESS}</address>
<mask>{$IPSUBNET}</mask>
</primary>
</address>
</ip>
</Loopback>
</interface>
</config>
</device>
</devices>
</config>
Let us know if this covers what you need.
Dimitris
08-10-2017 12:14 AM
That would be suitable for my needs, if it were working.
<Loopback annotation="{$DESCRIPTION}">
Is accepted in xml template and the template is working like before.
Alas, annotation is not created, at least not shown in "commit dry-run".
I am running ncs-4.4.2.
11-02-2021 07:45 AM
This still does not work in NSO 5.5.1. It just puts the raw value into the annotation and does not do variable substitution.
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