cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
173
Views
5
Helpful
1
Replies
Highlighted
Cisco Employee

Special characters on XML template

Hello, hope you are well

I am trying to create a service template that is configuring a confd server, which contains some variables as part of the config:

 

(...)
<netplan>
<template>network:
ethernets:
ens192:
addresses: [{{K8S_SSH_IP}}/26]
dhcp4: false
</template>
</netplan>
(...)

 

{{K8S_SSH_IP}} is a variable that is part of the configuration to be sent, not meant to be replaced by NSO.

 

On packages reload, I see the following error:

 

info deployments-5g-template.xml:50 failed to compile: '{K8S_SSH_IP' reason: Invalid name: {K8S_S

 

Is there a way to escape those characters so the XML engine does not try to parse them?

Thanks in advance

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Cisco Employee

Yes, you can '\' backslash the curly brackets:

 

<netplan>

<template>network:

 ethernets:

 ens192:

 addresses: [\{\{K8S_SSH_IP\}\}/26]

 dhcp4: false



</template>



</netplan>

View solution in original post

1 REPLY 1
Highlighted
Cisco Employee

Yes, you can '\' backslash the curly brackets:

 

<netplan>

<template>network:

 ethernets:

 ens192:

 addresses: [\{\{K8S_SSH_IP\}\}/26]

 dhcp4: false



</template>



</netplan>

View solution in original post