-
Notifications
You must be signed in to change notification settings - Fork 330
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
azure_rm_aks: add a test for the minimal parameters cluster definition
- Loading branch information
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
73 changes: 73 additions & 0 deletions
73
tests/integration/targets/azure_rm_aks/tasks/minimal-cluster.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
- set_fact: | ||
rpfx: "{{ resource_group | hash('md5') | truncate(8, True, '') }}" | ||
noderpfx: "{{ resource_group | hash('md5') | truncate(4, True, '') }}" | ||
|
||
- name: Use minimal parameters and system-assigned identity | ||
azure_rm_aks: | ||
name: "minimal{{ rpfx }}" | ||
location: eastus | ||
resource_group: "{{ resource_group }}" | ||
dns_prefix: "aks{{ rpfx }}" | ||
agent_pool_profiles: | ||
- name: default | ||
count: 1 | ||
vm_size: Standard_DS1_v2 | ||
register: output | ||
|
||
- name: Assert the AKS instance is well created | ||
assert: | ||
that: | ||
- output.changed | ||
- output.provisioning_state == 'Succeeded' | ||
|
||
- name: Get AKS fact | ||
azure_rm_aks_info: | ||
name: "minimal{{ rpfx }}" | ||
resource_group: "{{ resource_group }}" | ||
register: fact | ||
|
||
- name: Assert fact returns the created one | ||
assert: | ||
that: | ||
- "fact.aks | length == 1" | ||
- fact.aks[0].id == output.id | ||
|
||
- name: Use minimal parameters and system-assigned identity (idempotent) | ||
azure_rm_aks: | ||
name: "minimal{{ rpfx }}" | ||
location: eastus | ||
resource_group: "{{ resource_group }}" | ||
dns_prefix: "aks{{ rpfx }}" | ||
agent_pool_profiles: | ||
- name: default | ||
count: 1 | ||
vm_size: Standard_DS1_v2 | ||
register: output | ||
|
||
- name: Assert idempotent | ||
assert: | ||
that: | ||
- not output.changed | ||
|
||
- name: Delete the AKS instance | ||
azure_rm_aks: | ||
name: "minimal{{ rpfx }}" | ||
resource_group: "{{ resource_group }}" | ||
state: absent | ||
register: output | ||
|
||
- name: Assert the AKS instance is well deleted | ||
assert: | ||
that: | ||
- output.changed | ||
|
||
- name: Get AKS fact | ||
azure_rm_aks_info: | ||
name: "minimal{{ rpfx }}" | ||
resource_group: "{{ resource_group }}" | ||
register: fact | ||
|
||
- name: Assert fact returns empty | ||
assert: | ||
that: | ||
- "fact.aks | length == 0" |