mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
fixing updating image reference in vmss (#49758)
This commit is contained in:
parent
daaca1abd5
commit
a24cc8b235
3 changed files with 112 additions and 20 deletions
|
@ -558,6 +558,13 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase):
|
|||
changed = True
|
||||
vmss_dict['properties']['upgradePolicy']['mode'] = self.upgrade_policy
|
||||
|
||||
if image_reference and \
|
||||
image_reference.as_dict() != vmss_dict['properties']['virtualMachineProfile']['storageProfile']['imageReference']:
|
||||
self.log('CHANGED: virtual machine scale set {0} - Image'.format(self.name))
|
||||
differences.append('Image')
|
||||
changed = True
|
||||
vmss_dict['properties']['virtualMachineProfile']['storageProfile']['imageReference'] = image_reference.as_dict()
|
||||
|
||||
update_tags, vmss_dict['tags'] = self.update_tags(vmss_dict.get('tags', dict()))
|
||||
if update_tags:
|
||||
differences.append('Tags')
|
||||
|
@ -739,6 +746,8 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase):
|
|||
))
|
||||
vmss_resource.virtual_machine_profile.storage_profile.data_disks = data_disks
|
||||
|
||||
if image_reference is not None:
|
||||
vmss_resource.virtual_machine_profile.storage_profile.image_reference = image_reference
|
||||
self.log("Update virtual machine with parameters:")
|
||||
self.create_or_update_vmss(vmss_resource)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue