mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
fix for special case of last element of url (#43354)
* fix for special case of last element of url * improved version * fixed mistake * adding appropriate test * fix problem * just fixed task name
This commit is contained in:
parent
c344a94846
commit
c8fcbdef71
3 changed files with 59 additions and 16 deletions
|
@ -1,6 +1,7 @@
|
|||
- name: Prepare random number
|
||||
set_fact:
|
||||
nsgname: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}"
|
||||
storageaccountname: "stacc{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}"
|
||||
run_once: yes
|
||||
|
||||
- name: Call REST API
|
||||
|
@ -54,7 +55,6 @@
|
|||
assert:
|
||||
that: output.changed
|
||||
|
||||
|
||||
- name: Try to get information about account
|
||||
azure_rm_resource_facts:
|
||||
api_version: '2018-02-01'
|
||||
|
@ -63,3 +63,25 @@
|
|||
resource_type: networksecuritygroups
|
||||
resource_name: "{{ nsgname }}"
|
||||
register: output
|
||||
|
||||
- name: Create storage account for Registry
|
||||
azure_rm_storageaccount:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: "{{ storageaccountname }}"
|
||||
type: Standard_LRS
|
||||
|
||||
- name: Try to storage keys -- special case when subresource part has no name
|
||||
azure_rm_resource:
|
||||
resource_group: "{{ resource_group }}"
|
||||
provider: storage
|
||||
resource_type: storageAccounts
|
||||
resource_name: "{{ storageaccountname }}"
|
||||
subresource:
|
||||
- type: listkeys
|
||||
api_version: '2018-03-01-preview'
|
||||
method: POST
|
||||
register: keys
|
||||
|
||||
- name: Assert that key was returned
|
||||
assert:
|
||||
that: keys['response']['keys'][0]['value'] | length > 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue