-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.tmpl
More file actions
52 lines (30 loc) · 773 Bytes
/
test.tmpl
File metadata and controls
52 lines (30 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Testing single hash field
db_policy/name: {{key "db_policy/name" "narf"}}
Testing array
{{range list "arraytest"}}
Entry: {{.}}
{{end}}
Testing array with index
{{range $index, $entry := list "arraytest"}}
Entry: {{$index}} {{$entry}}
{{end}}
Testing hash
{{range hash "db_policy"}}
<!-- From: {{.Source}} -->
<attr key='{{.Key}}' val='{{.Value}}'/>{{end}}
blarf:
{{key "db_policy/pod_asdfconfig" "mydefault"}}
DEBUG: Testing array
{{range listd "arraytest"}}
Entry: {{.Value}} (From: {{.Source}})
{{end}}
DEBUG: Testing string:
{{with keyd "string" "somethingdef"}}
Value: {{.Value}}
Source: {{.Source}}
{{end}}
DEBUG: Testing string with default
{{with keyd "stringnoexist" "thedefault"}}
Value: {{.Value}}
Source: {{.Source}}
{{end}}