-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #350 from linode/dev
Release v0.15.2
- Loading branch information
Showing
7 changed files
with
72 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
tests/integration/targets/api_request_extra/tasks/main.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# this test is to test a json_body with integer inside as a value of a key | ||
|
||
- name: api_request_extra | ||
block: | ||
- set_fact: | ||
r: "{{ 1000000000 | random }}" | ||
|
||
- name: List all available Linode regions | ||
linode.cloud.region_list: | ||
register: regions | ||
|
||
- name: Create a volume by the api_request module | ||
linode.cloud.api_request: | ||
path: "/volumes" | ||
method: POST | ||
body_json: > | ||
{ | ||
"label": "ansible-test-{{ r }}", | ||
"size": 10, | ||
"region": "{{ regions.regions[0].id }}" | ||
} | ||
register: response | ||
|
||
- name: Assert volume created | ||
assert: | ||
that: | ||
- response.changed | ||
|
||
always: | ||
- ignore_errors: true | ||
block: | ||
- name: Delete the volume | ||
linode.cloud.volume: | ||
label: '{{ response.body.label }}' | ||
state: absent | ||
register: delete_volume | ||
until: delete_volume.changed | ||
retries: 5 | ||
delay: 10 | ||
|
||
- name: Assert the volume was deleted | ||
assert: | ||
that: | ||
- delete_volume.changed | ||
|
||
environment: | ||
LINODE_UA_PREFIX: '{{ ua_prefix }}' | ||
LINODE_API_TOKEN: '{{ api_token }}' |