mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Azure Virtual Machine Scale Set support (azure_rm_virtualmachine_scaleset) (#28381)
* initial virtual machine scaleset implementation * added docs * fixed formatting * added update feature for os disk caching and capacity * add tier * added return * add integration tests * add vmss facts * add data disk support * added data disks docs * update integration test
This commit is contained in:
parent
75998d3ca3
commit
2ea017a794
5 changed files with 1091 additions and 0 deletions
|
@ -0,0 +1,3 @@
|
|||
cloud/azure
|
||||
posix/ci/cloud/azure
|
||||
destructive
|
|
@ -0,0 +1,2 @@
|
|||
dependencies:
|
||||
- setup_azure
|
|
@ -0,0 +1,88 @@
|
|||
- name: Create virtual network
|
||||
azure_rm_virtualnetwork:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVnet
|
||||
address_prefixes: "10.0.0.0/16"
|
||||
|
||||
- name: Add subnet
|
||||
azure_rm_subnet:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testSubnet
|
||||
address_prefix: "10.0.1.0/24"
|
||||
virtual_network: testVnet
|
||||
|
||||
- name: Create public IP address
|
||||
azure_rm_publicipaddress:
|
||||
resource_group: "{{ resource_group }}"
|
||||
allocation_method: Dynamic
|
||||
name: testPublicIP
|
||||
|
||||
- name: Create VMSS
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS
|
||||
vm_size: Standard_DS1_v2
|
||||
admin_username: testuser
|
||||
ssh_password_enabled: true
|
||||
admin_password: "Password1234!"
|
||||
capacity: 2
|
||||
virtual_network_name: testVnet
|
||||
subnet_name: testSubnet
|
||||
upgrade_policy: Manual
|
||||
tier: Standard
|
||||
managed_disk_type: Standard_LRS
|
||||
os_disk_caching: ReadWrite
|
||||
image:
|
||||
offer: CoreOS
|
||||
publisher: CoreOS
|
||||
sku: Stable
|
||||
version: latest
|
||||
data_disks:
|
||||
- lun: 0
|
||||
disk_size_gb: 64
|
||||
caching: ReadWrite
|
||||
managed_disk_type: Standard_LRS
|
||||
register: results
|
||||
|
||||
- name: Assert that VMSS ran
|
||||
assert:
|
||||
that: results.changed
|
||||
|
||||
- name: Delete VMSS
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS
|
||||
state: absent
|
||||
remove_on_absent: ['all']
|
||||
vm_size: Standard_DS1_v2
|
||||
admin_username: testuser
|
||||
capacity: 2
|
||||
virtual_network_name: testVnet
|
||||
subnet_name: testSubnet
|
||||
upgrade_policy: Manual
|
||||
tier: Standard
|
||||
os_disk_caching: ReadWrite
|
||||
image:
|
||||
offer: CoreOS
|
||||
publisher: CoreOS
|
||||
sku: Stable
|
||||
version: latest
|
||||
data_disks:
|
||||
- lun: 0
|
||||
disk_size_gb: 64
|
||||
caching: ReadWrite
|
||||
managed_disk_type: Standard_LRS
|
||||
|
||||
- name: Delete public IP address
|
||||
azure_rm_publicipaddress:
|
||||
resource_group: "{{ resource_group }}"
|
||||
allocation_method: Dynamic
|
||||
state: absent
|
||||
name: testPublicIP
|
||||
|
||||
- name: Delete virtual network
|
||||
azure_rm_virtualnetwork:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVnet
|
||||
state: absent
|
||||
address_prefixes: "10.0.0.0/16"
|
Loading…
Add table
Add a link
Reference in a new issue