1 import { Parser } from './Parser';
3 export class JinjaYMLParser implements Parser {
4 variables: Set<string> = new Set();
5 getVariables(fileContent: string): string[] {
6 if (fileContent.includes('{{')) {
7 const xmlSplit = fileContent.split(new RegExp('[{]+[ ]*.[V-v]alues.'));
8 for (const val of xmlSplit) {
9 const res = val.substring(0, val.indexOf('}}'));
10 if (res && res.length > 0) {
11 this.variables.add(res.trim());
16 return [...this.variables];
22 vf-module-name: {{ .Values.vpg_name_0 }}
23 <?xml version="1.0" encoding="UTF-8"?>
24 <configuration xmlns:junos="http://xml.juniper.net/junos/17.4R1/junos">
25 <system xmlns="http://yang.juniper.net/junos-qfx/conf/system">
26 <host-name operation="delete" />
27 <host-name operation="create">[hostname]</host-name>