You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/azure_rm_resourcegroup/tasks/main.yml

39 lines
826 B
YAML

- name: Get resource group facts
azure_rm_resourcegroup_facts:
register: rg
- assert:
that:
- rg.resourcegroups | length >= 1
- name: Get resource group facts
azure_rm_resourcegroup_facts:
name: "{{ resource_group }}"
list_resources: yes
register: rg
- assert:
that:
- rg.resourcegroups | length == 1
- rg.resourcegroups[0].resources | length >= 0
- name: Create resource group (idempontent)
azure_rm_resourcegroup:
name: "{{ resource_group }}"
location: "{{ rg.resourcegroups[0].location }}"
register: output
- assert:
that:
- not output.changed
- name: delete resource group
azure_rm_resourcegroup:
name: "{{ resource_group }}"
state: absent
check_mode: yes
register: output
- assert:
that:
- output.changed