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