-
Notifications
You must be signed in to change notification settings - Fork 4
/
c0126.yml
60 lines (49 loc) · 1023 Bytes
/
c0126.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
doc_meta: |
folder: flow-controll
title: else in hard way
head: |
Try to implement the else logic using if condition
It works but it is not dry
sections:
- title: Demo
log: yes
notes:
goal:
- try to see if it possible to make a flow controll of else logic
- intro the 1st solution doing if else
vars:
goahead: False
# goahead: True
tasks:
- name: task
task:
- func: cmd
do:
-
name: print
cmd: |
true/false value of goahead:
{{.goahead}}
{{not .goahead}}
- func: call
do:
- goahead
if: '{{.goahead}}'
- func: call
do:
- else
if: '{{not .goahead}}'
- name: goahead
task:
- func: cmd
do:
-
name: print
cmd: 'go ahead .......'
- name: else
task:
- func: cmd
do:
-
name: print
cmd: 'do something else .......'