Azure create virtual machine with an Availability Set associate (#32535)

* add availability set for vm

* add test

* add import

* fix

* add test assert and output

* fix lint and version added

* add null check

* fix mirror

* fix mirror
This commit is contained in:
Yuwei Zhou 2017-11-23 12:53:53 +08:00 committed by Matt Davis
parent 3129cbb9e1
commit e4194b20db
2 changed files with 43 additions and 1 deletions

View file

@ -16,6 +16,11 @@
name: "{{ storage_account }}"
account_type: Standard_LRS
- name: Create an availability set
azure_rm_availabilityset:
name: "avbs{{ resource_group | hash('md5') | truncate(7, True, '') }}"
resource_group: "{{ resource_group }}"
- name: Create virtual network
azure_rm_virtualnetwork:
resource_group: "{{ resource_group }}"
@ -62,6 +67,7 @@
short_hostname: testvm
os_type: Linux
network_interfaces: testvm001
availability_set: "avbs{{ resource_group | hash('md5') | truncate(7, True, '') }}"
image:
offer: UbuntuServer
publisher: Canonical
@ -69,6 +75,10 @@
version: latest
register: output
- assert:
that:
- azure_vm.properties.availabilitySet.id
- name: Restart the virtual machine
azure_rm_virtualmachine:
resource_group: "{{ resource_group }}"