11-06-2019 06:20 AM
I'm trying to create a template-based service that sets specific content. I have the following now;
<config-template xmlns="http://tail-f.com/ns/config/1.0" servicepoint="location-vlan">
<devices xmlns="http://tail-f.com/ns/ncs">
<?foreach {../../location:location[code=string(/location)]/location:device}?>
<device>
<name>{name}</name>
<config>
<hostname xmlns="urn:ios">{../../ncs:devices/ncs:device[name=string(name)]/ncs:authgroup}</hostname>
<!-- Remove the following -->
<ip xmlns="urn:ios">
<domain>
<name>{string(name)}</name>
</domain>
</ip>
<!-- / -->
</config>
</device>
<?end?>
</devices>
</config-template>The 'string(name)' on the domain part is working perfectly, but on the hostname part it isn't. When I replace the 'string(name)' on the hostname part with a litteral hostname (like 'dm-vsw-bhn-001') it works perfectly.
What am I doing wrong?
Daryl
Solved! Go to Solution.
11-06-2019 07:16 AM
Can't promise anything, but try replacing [name=string(name)] with [name=current()/name]
Try using commit dry-run | debug template to find any clues on what might not be working as expected.
11-06-2019 07:16 AM
Can't promise anything, but try replacing [name=string(name)] with [name=current()/name]
Try using commit dry-run | debug template to find any clues on what might not be working as expected.
11-06-2019 09:36 AM
That did the trick! Thank you
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