-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for ZRS disks in virtualdisk and manageddisk modules
- Loading branch information
1 parent
70feb11
commit 05f3972
Showing
6 changed files
with
162 additions
and
5 deletions.
There are no files selected for viewing
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
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
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
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
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
89 changes: 89 additions & 0 deletions
89
tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_minimal_manageddisk.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,89 @@ | ||
- include_tasks: setup.yml | ||
|
||
- name: Create minimal VM with defaults and a custom managed disk type | ||
azure_rm_virtualmachine: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ vm_name }}" | ||
admin_username: "testuser" | ||
ssh_password_enabled: false | ||
managed_disk_type: StandardSSD_ZRS | ||
public_ip_allocation_method: Disabled | ||
ssh_public_keys: | ||
- path: /home/testuser/.ssh/authorized_keys | ||
key_data: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfoYlIV4lTPZTv7hXaVwQQuqBgGs4yeNRX0SPo2+HQt9u4X7IGwrtXc0nEUm6LfaCikMH58bOL8f20NTGz285kxdFHZRcBXtqmnMz2rXwhK9gwq5h1khc+GzHtdcJXsGA4y0xuaNcidcg04jxAlN/06fwb/VYwwWTVbypNC0gpGEpWckCNm8vlDlA55sU5et0SZ+J0RKVvEaweUOeNbFZqckGPA384imfeYlADppK/7eAxqfBVadVvZG8IJk4yvATgaIENIFj2cXxqu2mQ/Bp5Wr45uApvJsFXmi+v/nkiOEV1QpLOnEwAZo6EfFS4CCQtsymxJCl1PxdJ5LD4ZOtP [email protected]" | ||
vm_size: Standard_B1ms | ||
virtual_network: "{{ network_name }}" | ||
image: | ||
offer: UbuntuServer | ||
publisher: Canonical | ||
sku: 16.04-LTS | ||
version: latest | ||
register: vm_output | ||
|
||
- name: Delete VM | ||
azure_rm_virtualmachine: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ vm_name }}" | ||
remove_on_absent: all_autocreated | ||
state: absent | ||
|
||
- name: Query auto created NIC | ||
azure_rm_networkinterface_info: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ vm_name }}01" | ||
register: nic_result | ||
|
||
- name: Query auto created security group | ||
azure_rm_securitygroup_info: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ vm_name }}01" | ||
register: nsg_result | ||
|
||
- name: Query auto created disk | ||
azure_rm_manageddisk_info: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ vm_name }}" | ||
register: disk_result | ||
|
||
- name: Assert that disk was created with the right storage class | ||
assert: | ||
that: | ||
- disk_result.ansible_info.azure_managed_disk[0].storage_account_type == "StandardSSD_ZRS" | ||
|
||
- name: Assert that autocreated resources were deleted | ||
assert: | ||
that: | ||
- nic_result.networkinterfaces | length == 0 | ||
- nsg_result.securitygroups | length == 0 | ||
|
||
- name: Destroy disk | ||
azure_rm_manageddisk: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ vm_name }}" | ||
state: absent | ||
|
||
- name: Destroy subnet | ||
azure_rm_subnet: | ||
resource_group: "{{ resource_group }}" | ||
virtual_network: "{{ network_name }}" | ||
name: "{{ subnet_name }}" | ||
state: absent | ||
|
||
- name: Destroy virtual network | ||
azure_rm_virtualnetwork: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ network_name }}" | ||
state: absent | ||
|
||
- name: Destroy availability set | ||
azure_rm_availabilityset: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ availability_set }}" | ||
state: absent | ||
|
||
- name: Destroy storage account | ||
azure_rm_storageaccount: | ||
resource_group: "{{ resource_group }}" | ||
name: "{{ storage_account }}" | ||
force_delete_nonempty: yes | ||
state: absent |