-
Notifications
You must be signed in to change notification settings - Fork 4
/
c0025.yml
50 lines (40 loc) · 1.13 KB
/
c0025.yml
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
doc_meta: |
folder: dvars
title: string literal
head: |
Showcase a dvar's value could reference to a object's sub element
sections:
- title: Yml string is essentially the object
content: |
This demo shows that a dvar stores a dynamic value, which is in yml format
The yml string could be converted to a object and registered in execution runtime. We will detail this later
- title: Demo
log: yes
notes:
goal:
- to show complex object using dynamic var
design:
- to make it simple, the dvar value is always a string
- |
the string could be a formated yaml, so that you can
convert it to yaml then a object
- register the object into that scope's vars list
- consider a modified name of -> a_smart_guy_obj to reference to
vars:
student:
name: Tom
gender: Male
school: Sydney Grammar
dvars:
- name: a_smart_guy
value: |
name: "{{.student.name}}"
sex: "{{.student.gender}}"
school: "{{.student.school}}"
tasks:
- name: task
task:
-
func: shell
do:
- echo """a smart guy=>{{.a_smart_guy}}"""