1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/azure_rm_resource/tasks/main.yml
Zim Kalinowski 2c60771096 introducing azure_rm_resource (#39274)
* introducing azure_rm_resource

* adding missing file

* fixed documentation

* fixed subresource

* don't support tags (yet)

* added api_version to the doc

* adding api version to the doc

* ignoring some doc checks

* fixing imports

* final sanity fixes

* adding idempotency

* fixed params

* missing query parameter

* some updates of azure_rm_resource

* try to update test for idempotency

* fixed test

* try to fix problem temporarily

* another approach

* fixed spelling

* fixed mistake

* refactored a bit

* fixes

* removed unnecessary code

* removed assert temporarily

* fixed documentation

* trying to fix import issues

* trying to fix import

* try to fix sanity

* removed unnecessary pass

* removed e324 ignores

* resolve conflicts in ignore.txt

* fixing ignore txt

* revert

* try different approach to idempotency

* updating tests

* fixed task

* fixes

* getting output value properly

* fix test

* missing change

* fixed bug, changed test

* fixed mistake

* fixed mistake
2018-05-23 16:55:57 -07:00

77 lines
1.9 KiB
YAML

- name: Prepare random number
set_fact:
rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}"
run_once: yes
- name: Call REST API - StorageAccounts_Create
azure_rm_resource:
api_version: '2017-10-01'
resource_group: "{{ resource_group }}"
provider: storage
resource_type: storageaccounts
resource_name: stacc{{ rpfx }}
body:
sku:
name: Standard_LRS
kind: BlobStorage
location: eastus
properties:
accessTier: Hot
idempotency: yes
register: output
- name: Assert that something has changed
assert:
that: output.changed
- name: Call REST API - StorageAccounts_Create - with same parameters
azure_rm_resource:
api_version: '2017-10-01'
resource_group: "{{ resource_group }}"
provider: storage
resource_type: storageaccounts
resource_name: stacc{{ rpfx }}
body:
sku:
name: Standard_LRS
kind: BlobStorage
location: eastus
properties:
accessTier: Hot
idempotency: yes
register: output
- name: Assert that nothing has changed
assert:
that: not output.changed
- name: Call REST API - StorageAccounts_Create - with different parameters
azure_rm_resource:
api_version: '2017-10-01'
resource_group: "{{ resource_group }}"
provider: storage
resource_type: storageaccounts
resource_name: stacc{{ rpfx }}
body:
sku:
name: Standard_LRS
kind: BlobStorage
location: eastus
properties:
accessTier: Cool
idempotency: yes
register: output
- name: Assert that something has changed
assert:
that: output.changed
- name: Try to get information about account
azure_rm_resource_facts:
api_version: '2017-10-01'
resource_group: "{{ resource_group }}"
provider: storage
resource_type: storageaccounts
resource_name: stacc{{ rpfx }}
register: output