using lighter resource (#41223)

This commit is contained in:
Zim Kalinowski 2018-06-07 14:11:00 +08:00 committed by Yunge Zhu
parent a73585552f
commit bc690df11e

View file

@ -1,22 +1,17 @@
- name: Prepare random number - name: Prepare random number
set_fact: set_fact:
rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" nsgname: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}"
run_once: yes run_once: yes
- name: Call REST API - StorageAccounts_Create - name: Call REST API
azure_rm_resource: azure_rm_resource:
api_version: '2017-10-01' api_version: '2018-02-01'
resource_group: "{{ resource_group }}" resource_group: "{{ resource_group }}"
provider: storage provider: network
resource_type: storageaccounts resource_type: networksecuritygroups
resource_name: stacc{{ rpfx }} resource_name: "{{ nsgname }}"
body: body:
sku:
name: Standard_LRS
kind: BlobStorage
location: eastus location: eastus
properties:
accessTier: Hot
idempotency: yes idempotency: yes
register: output register: output
@ -24,20 +19,15 @@
assert: assert:
that: output.changed that: output.changed
- name: Call REST API - StorageAccounts_Create - with same parameters - name: Call REST API
azure_rm_resource: azure_rm_resource:
api_version: '2017-10-01' api_version: '2018-02-01'
resource_group: "{{ resource_group }}" resource_group: "{{ resource_group }}"
provider: storage provider: network
resource_type: storageaccounts resource_type: networksecuritygroups
resource_name: stacc{{ rpfx }} resource_name: "{{ nsgname }}"
body: body:
sku:
name: Standard_LRS
kind: BlobStorage
location: eastus location: eastus
properties:
accessTier: Hot
idempotency: yes idempotency: yes
register: output register: output
@ -45,20 +35,18 @@
assert: assert:
that: not output.changed that: not output.changed
- name: Call REST API - StorageAccounts_Create - with different parameters - name: Call REST API
azure_rm_resource: azure_rm_resource:
api_version: '2017-10-01' api_version: '2018-02-01'
resource_group: "{{ resource_group }}" resource_group: "{{ resource_group }}"
provider: storage provider: network
resource_type: storageaccounts resource_type: networksecuritygroups
resource_name: stacc{{ rpfx }} resource_name: "{{ nsgname }}"
body: body:
sku:
name: Standard_LRS
kind: BlobStorage
location: eastus location: eastus
properties: tags:
accessTier: Cool a: "abc"
b: "cde"
idempotency: yes idempotency: yes
register: output register: output
@ -69,9 +57,9 @@
- name: Try to get information about account - name: Try to get information about account
azure_rm_resource_facts: azure_rm_resource_facts:
api_version: '2017-10-01' api_version: '2018-02-01'
resource_group: "{{ resource_group }}" resource_group: "{{ resource_group }}"
provider: storage provider: network
resource_type: storageaccounts resource_type: networksecuritygroups
resource_name: stacc{{ rpfx }} resource_name: "{{ nsgname }}"
register: output register: output