mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
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:
parent
21ea92feca
commit
2c60771096
6 changed files with 643 additions and 0 deletions
3
test/integration/targets/azure_rm_resource/aliases
Normal file
3
test/integration/targets/azure_rm_resource/aliases
Normal file
|
@ -0,0 +1,3 @@
|
|||
cloud/azure
|
||||
destructive
|
||||
posix/ci/cloud/group2/azure
|
2
test/integration/targets/azure_rm_resource/meta/main.yml
Normal file
2
test/integration/targets/azure_rm_resource/meta/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
dependencies:
|
||||
- setup_azure
|
77
test/integration/targets/azure_rm_resource/tasks/main.yml
Normal file
77
test/integration/targets/azure_rm_resource/tasks/main.yml
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue