-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_compliance_check.yaml
More file actions
42 lines (37 loc) · 1.24 KB
/
run_compliance_check.yaml
File metadata and controls
42 lines (37 loc) · 1.24 KB
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
---
- name: Make HTTP POST request to run a compliance check.
hosts: localhost
gather_facts: no
vars_files:
- vars/env/extravars
tasks:
- name: Load the replication plan id variable file
ansible.builtin.include_vars:
file: ./vars/replication_plan.json
name: replication_plan
- name: Get the replication plan ID
ansible.builtin.debug:
msg: "{{ replication_plan.json.id }}"
- name: Trigger compliance check job for replication plan
uri:
url: "https://snapcenter.cloudmanager.cloud.netapp.com/api/vmdr/compliancecheck"
method: post
return_content: yes
headers:
Content-Type: "application/json"
x-agent-id: "{{ agentid }}"
Authorization: "{{ authorization }}"
x-account-id: "{{ accountid }}"
body: >
{
"id": "{{ replication_plan.json.id }}"
}
body_format: json
status_code: [200, 202, 201]
register: result
- name: Setting compliance job result value.
ansible.builtin.set_fact:
compliance_job_result: "{{ result }}"
- name: Print the compliance check job ID
ansible.builtin.debug:
msg: "{{ compliance_job_result.json.id }}"