support overprovision in azure_rm_vmss (#49806)
parent
f2eef2d30b
commit
7609a8cdd6
|
@ -197,6 +197,12 @@ options:
|
||||||
version_added: "2.7"
|
version_added: "2.7"
|
||||||
aliases:
|
aliases:
|
||||||
- security_group_name
|
- security_group_name
|
||||||
|
overprovision:
|
||||||
|
description:
|
||||||
|
- Specifies whether the Virtual Machine Scale Set should be overprovisioned.
|
||||||
|
type: bool
|
||||||
|
default: True
|
||||||
|
version_added: "2.8"
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- azure
|
- azure
|
||||||
|
@ -403,7 +409,8 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase):
|
||||||
virtual_network_name=dict(type='str', aliases=['virtual_network']),
|
virtual_network_name=dict(type='str', aliases=['virtual_network']),
|
||||||
remove_on_absent=dict(type='list', default=['all']),
|
remove_on_absent=dict(type='list', default=['all']),
|
||||||
enable_accelerated_networking=dict(type='bool'),
|
enable_accelerated_networking=dict(type='bool'),
|
||||||
security_group=dict(type='raw', aliases=['security_group_name'])
|
security_group=dict(type='raw', aliases=['security_group_name']),
|
||||||
|
overprovision=dict(type='bool', default=True)
|
||||||
)
|
)
|
||||||
|
|
||||||
self.resource_group = None
|
self.resource_group = None
|
||||||
|
@ -432,6 +439,7 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase):
|
||||||
self.load_balancer = None
|
self.load_balancer = None
|
||||||
self.enable_accelerated_networking = None
|
self.enable_accelerated_networking = None
|
||||||
self.security_group = None
|
self.security_group = None
|
||||||
|
self.overprovision = None
|
||||||
|
|
||||||
self.results = dict(
|
self.results = dict(
|
||||||
changed=False,
|
changed=False,
|
||||||
|
@ -570,6 +578,10 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase):
|
||||||
differences.append('Tags')
|
differences.append('Tags')
|
||||||
changed = True
|
changed = True
|
||||||
|
|
||||||
|
if bool(self.overprovision) != bool(vmss_dict['properties']['overprovision']):
|
||||||
|
differences.append('overprovision')
|
||||||
|
changed = True
|
||||||
|
|
||||||
self.differences = differences
|
self.differences = differences
|
||||||
|
|
||||||
elif self.state == 'absent':
|
elif self.state == 'absent':
|
||||||
|
@ -638,6 +650,7 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase):
|
||||||
|
|
||||||
vmss_resource = self.compute_models.VirtualMachineScaleSet(
|
vmss_resource = self.compute_models.VirtualMachineScaleSet(
|
||||||
location=self.location,
|
location=self.location,
|
||||||
|
overprovision=self.overprovision,
|
||||||
tags=self.tags,
|
tags=self.tags,
|
||||||
upgrade_policy=self.compute_models.UpgradePolicy(
|
upgrade_policy=self.compute_models.UpgradePolicy(
|
||||||
mode=self.upgrade_policy
|
mode=self.upgrade_policy
|
||||||
|
@ -731,6 +744,7 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase):
|
||||||
vmss_resource = self.get_vmss()
|
vmss_resource = self.get_vmss()
|
||||||
vmss_resource.virtual_machine_profile.storage_profile.os_disk.caching = self.os_disk_caching
|
vmss_resource.virtual_machine_profile.storage_profile.os_disk.caching = self.os_disk_caching
|
||||||
vmss_resource.sku.capacity = self.capacity
|
vmss_resource.sku.capacity = self.capacity
|
||||||
|
vmss_resource.overprovision = self.overprovision
|
||||||
|
|
||||||
if self.data_disks is not None:
|
if self.data_disks is not None:
|
||||||
data_disks = []
|
data_disks = []
|
||||||
|
|
|
@ -182,6 +182,11 @@ vmss:
|
||||||
type: str
|
type: str
|
||||||
returned: always
|
returned: always
|
||||||
sample: Linux
|
sample: Linux
|
||||||
|
overprovision:
|
||||||
|
description:
|
||||||
|
- Specifies whether the Virtual Machine Scale Set should be overprovisioned.
|
||||||
|
type: bool
|
||||||
|
sample: true
|
||||||
resource_group:
|
resource_group:
|
||||||
description:
|
description:
|
||||||
- Resource group.
|
- Resource group.
|
||||||
|
@ -348,6 +353,7 @@ class AzureRMVirtualMachineScaleSetFacts(AzureRMModuleBase):
|
||||||
'image': vmss['properties']['virtualMachineProfile']['storageProfile']['imageReference'],
|
'image': vmss['properties']['virtualMachineProfile']['storageProfile']['imageReference'],
|
||||||
'os_disk_caching': vmss['properties']['virtualMachineProfile']['storageProfile']['osDisk']['caching'],
|
'os_disk_caching': vmss['properties']['virtualMachineProfile']['storageProfile']['osDisk']['caching'],
|
||||||
'os_type': 'Linux' if (vmss['properties']['virtualMachineProfile']['osProfile'].get('linuxConfiguration') is not None) else 'Windows',
|
'os_type': 'Linux' if (vmss['properties']['virtualMachineProfile']['osProfile'].get('linuxConfiguration') is not None) else 'Windows',
|
||||||
|
'overprovision': vmss['properties']['overprovision'],
|
||||||
'managed_disk_type': vmss['properties']['virtualMachineProfile']['storageProfile']['osDisk']['managedDisk']['storageAccountType'],
|
'managed_disk_type': vmss['properties']['virtualMachineProfile']['storageProfile']['osDisk']['managedDisk']['storageAccountType'],
|
||||||
'data_disks': data_disks,
|
'data_disks': data_disks,
|
||||||
'virtual_network_name': virtual_network_name,
|
'virtual_network_name': virtual_network_name,
|
||||||
|
|
|
@ -215,6 +215,7 @@
|
||||||
os_disk_caching: "{{ body.os_disk_caching }}"
|
os_disk_caching: "{{ body.os_disk_caching }}"
|
||||||
image: "{{ body.image }}"
|
image: "{{ body.image }}"
|
||||||
data_disks: "{{ body.data_disks }}"
|
data_disks: "{{ body.data_disks }}"
|
||||||
|
overprovision: "{{ body.overprovision }}"
|
||||||
register: results
|
register: results
|
||||||
|
|
||||||
- name: Assert that nothing was changed
|
- name: Assert that nothing was changed
|
||||||
|
|
Loading…
Reference in New Issue