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
This commit is contained in:
Zim Kalinowski 2018-05-24 07:55:57 +08:00 committed by Matt Davis
commit 2c60771096
6 changed files with 643 additions and 0 deletions

View file

@ -0,0 +1,3 @@
cloud/azure
destructive
posix/ci/cloud/group2/azure

View file

@ -0,0 +1,2 @@
dependencies:
- setup_azure

View file

@ -0,0 +1,77 @@
- 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