-
Notifications
You must be signed in to change notification settings - Fork 2
/
create_report.yml
41 lines (38 loc) · 1.16 KB
/
create_report.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
- name: Site Report
hosts: localhost
gather_facts: false
tasks:
- name: Create Site Report
uri:
url: "{{ nexpose_base_api }}/reports"
method: POST
user: "{{ nexpose_username }}"
password: "{{ nexpose_password }}"
force_basic_auth: yes
validate_certs: no
headers:
Content-Type: application/json
Accept: application/json
body: "{{ lookup('template','templates/reports/create_report.json.j2') }}"
body_format: json
status_code: 201
return_content: yes
register: create_site_report
- name: Generate Report
uri:
url: "{{ nexpose_base_api }}/reports/{{ report_id }}/generate"
method: POST
user: "{{ nexpose_username }}"
password: "{{ nexpose_password }}"
force_basic_auth: yes
validate_certs: no
return_content: yes
register: generate_site_report
- name: Download Report
get_url:
url: "{{ nexpose_base_api }}/reports/{{ report_id }}/history/latest/output"
dest: "./reports/report1.csv"
username: "{{ nexpose_username }}"
password: "{{ nexpose_password }}"
force_basic_auth: yes
validate_certs: no