-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yml
83 lines (71 loc) · 2.19 KB
/
main.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
---
- name: Install coverage
import_playbook: install.yml
when:
- test.activate | default(False)
- not test.containers
- name: Install coverage on containers
import_playbook: install_containers.yml
when:
- test.activate | default(False)
- test.containers
- name: Collect coverage data from all nodes
hosts: openstack_nodes
gather_facts: no
become: true
tasks:
- name: Set install vars
set_fact:
dfg: "{{ test.dfg }}"
- name: set os_version fact
set_fact:
os_version: "{{ test.openstack.version | openstack_release }}"
- name: Collect coverage data from all nodes
import_role:
name: openstack-coverage
tasks_from: collect.yml
vars:
aggregator: "{{ test.aggregator }}"
when:
- test.collect | default(False)
- not test.containers
- name: Collect coverage data from all containers on all nodes
import_role:
name: openstack-coverage
tasks_from: collect_containers.yml
vars:
aggregator: "{{ test.aggregator }}"
when:
- test.collect | default(False)
- test.containers
- name: Generate coverage report and Publish to SonarQube
hosts: "{{ test.aggregator }}"
gather_facts: no
become: true
tasks:
- name: Generate coverage report
import_role:
name: openstack-coverage
tasks_from: report.yml
when: test.report | default(False)
- name: Copy coverage report to storage
import_role:
name: openstack-coverage
tasks_from: storage.yml
when: test.get('storage', {}).activate | default(False)
- name: Publish to SonarQube
block:
- name: Set Sonar server vars
set_fact:
sonar_url: "{{ test.sonar.url }}"
sonar_login: "{{ test.sonar.login }}"
sonar_project: "{{ test.sonar.project }}"
- name: Set Sonar password
set_fact:
sonar_password: "{{ test.sonar.password }}"
when: test.sonar.password | default(False)
- name: include publish role
import_role:
name: openstack-coverage
tasks_from: publish.yml
when: test.publish | default(False)