-
Notifications
You must be signed in to change notification settings - Fork 4
/
c0130.yml
112 lines (102 loc) · 2.8 KB
/
c0130.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
doc_meta: |
folder: block-func
title: block in else
head: |
Add the support of execution of a flow using else tag
sections:
- title: Var auto merge applies the same to flow in else branch
content: |
Please notice that the values printed out in the else branch
- title: Demo
log: yes
vars:
a: global_aaa
b: global_bbb
c: global_ccc
goahead: False
# goahead: True
tasks:
- name: task
task:
- func: block
desc: show example the route goes to call goelse for the condition of not if condition succeeds
vars:
a: local_aaa
b: local_bbb
dvars:
- name: da
value: local_da
- name: db
value: local_db
do:
- func: shell
do:
- echo "shell step1"
- echo "shell step2"
- func: cmd
vars:
a: block_layer1_aaa
do:
-
name: print
cmd: |
layer 1
up_runtime_task_layer_number: {{.up_runtime_task_layer_number}}
a: {{.a}}
b: {{.b}}
c: {{.c}}
da: {{.da}}
db: {{.db}}
- func: shell
do:
- echo "shell step3"
- echo "shell step4"
- func: block
desc: test embeded 2nd layer of block
vars:
a: local_block_layer2_aaa
b: local_block_layer2_bbb
dvars:
- name: da
value: local_da_layer2
- name: db
value: local_db_layer2
do:
- func: cmd
vars:
a: block_layer2_aaa
do:
-
name: print
cmd: |
layer 2
up_runtime_task_layer_number: {{.up_runtime_task_layer_number}}
a: {{.a}}
b: {{.b}}
c: {{.c}}
da: {{.da}}
db: {{.db}}
- func: shell
do:
- echo "shell step5"
- echo "shell step6"
if: '{{.goahead}}'
else:
- func: shell
do:
- echo "else step1"
- echo "else step2"
- func: cmd
vars:
a: block_layer1_aaa_else
do:
-
name: print
cmd: |
layer 1
up_runtime_task_layer_number: {{.up_runtime_task_layer_number}}
a: {{.a}}
b: {{.b}}
c: {{.c}}
da: {{.da}}
db: {{.db}}