cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
619
Views
5
Helpful
1
Replies

Special characters on XML template

sfloresk
Cisco Employee
Cisco Employee

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

sunge
Cisco Employee
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

sunge
Cisco Employee
Cisco Employee

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

 

<netplan>

<template>network:

 ethernets:

 ens192:

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

 dhcp4: false



</template>



</netplan>