-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsample_1.yml
89 lines (75 loc) · 2.06 KB
/
sample_1.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
---
# Initial Step:
#
# Schedule a new job giving a specific topic and specifying the remote CI.
# The return of this action contains all the data associated with the job,
# we hence register those data for later consumptions
#
- hosts: localhost
gather_facts: false
tasks:
- include_tasks: 'new.yml'
- name: New
command: echo 'new'
# Pre-run state
#
# User is free to do whaterver she needs before entering pre-run state.
# Usually this is used to spawn the undercloud vm
#
- hosts: localhost
gather_facts: false
tasks:
- name: Set job state - pre-run
dci_job:
id: "{{ job_info.job.id }}"
status: "pre-run"
- name: Pre-run
command: echo 'pre-run'
# Running state
#
# User is free to do whaterver she needs before entering running state.
# Usually this is used to provision the undercloud and the overcloud
#
- hosts: localhost
gather_facts: false
tasks:
- name: Set job state - running
dci_job:
id: "{{ job_info.job.id }}"
status: "running"
- name: Running
command: echo 'running'
# Post-run state
#
# User is free to do whaterver she needs before entering post-run state.
# Usually this is used to run tests on the overcloud
#
- hosts: localhost
gather_facts: false
vars:
dci_status: 'post-run'
dci_comment: 'Post-run state commands'
tasks:
- name: Set job state - post-run
dci_job:
id: "{{ job_info.job.id }}"
status: "post-run"
- name: Post-Run
command: echo 'post-run'
# Success state
#
# User is free to do whaterver she needs before entering pre-run state.
# Usually this is used to teardown the plateform
#
- hosts: localhost
gather_facts: false
tasks:
- name: Set job state - success
dci_job:
id: "{{ job_info.job.id }}"
status: "success"
- name: Success
command: echo 'Succes'
- name: "Final step"
debug:
msg: "The job is now finished. Review the log at: {{ lookup('env','DCI_UI_URL') | default('https://www.distributed-ci.io', True) }}/jobs/{{ job_info.job.id }}/jobStates"