-
Notifications
You must be signed in to change notification settings - Fork 9
/
_20_testapi.yml
39 lines (35 loc) · 992 Bytes
/
_20_testapi.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
---
- hosts: all
gather_facts: false
tasks:
- name: Test API
uri:
url: "https://httpbin.org/status/200%2C201%2C202%2C203%2C204%2C205"
method: GET
#user: "test"
#password: "Passwo"
#validate_certs: no
force_basic_auth: yes
return_content: yes
status_code:
- 200
- 201
- 202
- 203
- 204
- 205
register: apiStatusOutput
until: apiStatusOutput.status == 205
retries: 20
delay: 1
# - name: Status message
# debug:
# msg: "Deletion of workload domain was successful, ID does not exist."
# when: apiStatusOutput.status == 404
# - name: The following IPs were found
# debug:
# msg: "IPs are: {{ apiStatusOutput.json.origin }}"
# - name: fail on error
# fail:
# msg: "Failing the job, errors in the return data: {{ apiStatusOutput.json.origin }}"
# when: apiStatusOutput.json.origin != "51.145.117.171, 51.145.117.171" #== for testing purposes