Rename inconsistent azure_rm_virtualmachine_scaleset modules (#54579)
@yungezz yes, i remember. pls keep in mind that they are not broken
This commit is contained in:
parent
97e7266633
commit
f9877fca18
8 changed files with 45 additions and 30 deletions
|
@ -0,0 +1 @@
|
|||
azure_rm_virtualmachinescaleset.py
|
|
@ -0,0 +1 @@
|
|||
azure_rm_virtualmachinescaleset_facts.py
|
|
@ -15,7 +15,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: azure_rm_virtualmachine_scaleset
|
||||
module: azure_rm_virtualmachinescaleset
|
||||
|
||||
version_added: "2.4"
|
||||
|
||||
|
@ -24,6 +24,9 @@ short_description: Manage Azure virtual machine scale sets.
|
|||
description:
|
||||
- Create and update a virtual machine scale set.
|
||||
|
||||
notes:
|
||||
- This module was called C(azure_rm_virtualmachine_scaleset) before Ansible 2.8. The usage did not change.
|
||||
|
||||
options:
|
||||
resource_group:
|
||||
description:
|
||||
|
@ -226,7 +229,7 @@ author:
|
|||
EXAMPLES = '''
|
||||
|
||||
- name: Create VMSS
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: myResourceGroup
|
||||
name: testvmss
|
||||
vm_size: Standard_DS1_v2
|
||||
|
@ -251,7 +254,7 @@ EXAMPLES = '''
|
|||
managed_disk_type: Standard_LRS
|
||||
|
||||
- name: Create a VMSS with a custom image
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: myResourceGroup
|
||||
name: testvmss
|
||||
vm_size: Standard_DS1_v2
|
||||
|
@ -264,7 +267,7 @@ EXAMPLES = '''
|
|||
image: customimage001
|
||||
|
||||
- name: Create a VMSS with a custom image from a particular resource group
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: myResourceGroup
|
||||
name: testvmss
|
||||
vm_size: Standard_DS1_v2
|
||||
|
@ -481,6 +484,9 @@ class AzureRMVirtualMachineScaleSet(AzureRMModuleBase):
|
|||
for key in list(self.module_arg_spec.keys()) + ['tags']:
|
||||
setattr(self, key, kwargs[key])
|
||||
|
||||
if self.module._name == 'azure_rm_virtualmachine_scaleset':
|
||||
self.module.deprecate("The 'azure_rm_virtualmachine_scaleset' module has been renamed to 'azure_rm_virtualmachinescaleset'", version='2.12')
|
||||
|
||||
# make sure options are lower case
|
||||
self.remove_on_absent = set([resource.lower() for resource in self.remove_on_absent])
|
||||
|
|
@ -13,7 +13,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: azure_rm_virtualmachine_scaleset_facts
|
||||
module: azure_rm_virtualmachinescaleset_facts
|
||||
|
||||
version_added: "2.4"
|
||||
|
||||
|
@ -22,6 +22,9 @@ short_description: Get Virtual Machine Scale Set facts
|
|||
description:
|
||||
- Get facts for a virtual machine scale set
|
||||
|
||||
notes:
|
||||
- This module was called C(azure_rm_virtualmachine_scaleset_facts) before Ansible 2.8. The usage did not change.
|
||||
|
||||
options:
|
||||
name:
|
||||
description:
|
||||
|
@ -36,7 +39,7 @@ options:
|
|||
description:
|
||||
- Format of the data returned.
|
||||
- If C(raw) is selected information will be returned in raw format from Azure Python SDK.
|
||||
- If C(curated) is selected the structure will be identical to input parameters of azure_rm_virtualmachine_scaleset module.
|
||||
- If C(curated) is selected the structure will be identical to input parameters of azure_rm_virtualmachinescaleset module.
|
||||
- In Ansible 2.5 and lower facts are always returned in raw format.
|
||||
- Please note that this option will be deprecated in 2.10 when curated format will become the only supported format.
|
||||
default: 'raw'
|
||||
|
@ -54,17 +57,17 @@ author:
|
|||
|
||||
EXAMPLES = '''
|
||||
- name: Get facts for a virtual machine scale set
|
||||
azure_rm_virtualmachine_scaleset_facts:
|
||||
azure_rm_virtualmachinescaleset_facts:
|
||||
resource_group: myResourceGroup
|
||||
name: testvmss001
|
||||
format: curated
|
||||
|
||||
- name: Get facts for all virtual networks
|
||||
azure_rm_virtualmachine_scaleset_facts:
|
||||
azure_rm_virtualmachinescaleset_facts:
|
||||
resource_group: myResourceGroup
|
||||
|
||||
- name: Get facts by tags
|
||||
azure_rm_virtualmachine_scaleset_facts:
|
||||
azure_rm_virtualmachinescaleset_facts:
|
||||
resource_group: myResourceGroup
|
||||
tags:
|
||||
- testing
|
||||
|
@ -289,6 +292,10 @@ class AzureRMVirtualMachineScaleSetFacts(AzureRMModuleBase):
|
|||
for key in self.module_args:
|
||||
setattr(self, key, kwargs[key])
|
||||
|
||||
if self.module._name == 'azure_rm_virtualmachine_scaleset_facts':
|
||||
self.module.deprecate("The 'azure_rm_virtualmachine_scaleset_facts' module has been renamed to 'azure_rm_virtualmachinescaleset_facts'",
|
||||
version='2.12')
|
||||
|
||||
if self.name and not self.resource_group:
|
||||
self.fail("Parameter error: resource group required when filtering by name.")
|
||||
if self.name:
|
|
@ -18,7 +18,7 @@
|
|||
virtual_network: testVnet
|
||||
|
||||
- name: Create VMSS
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS{{ rpfx }}
|
||||
vm_size: Standard_DS1_v2
|
||||
|
@ -199,7 +199,7 @@
|
|||
- not output.changed
|
||||
|
||||
- name: Clean VMSS
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
vm_size: Standard_DS1_v2
|
||||
name: testVMSS{{ rpfx }}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
cloud/azure
|
||||
shippable/azure/group4
|
||||
destructive
|
||||
azure_rm_virtualmachine_scaleset_facts
|
||||
azure_rm_virtualmachinescaleset_facts
|
||||
azure_rm_virtualmachinescalesetinstance_facts
|
||||
azure_rm_virtualmachinescalesetextension
|
||||
azure_rm_virtualmachinescalesetextension_facts
|
|
@ -92,7 +92,7 @@
|
|||
state: absent
|
||||
|
||||
- name: Create VMSS (check mode)
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS{{ rpfx }}
|
||||
vm_size: Standard_B1s
|
||||
|
@ -125,7 +125,7 @@
|
|||
that: results.changed
|
||||
|
||||
- name: Get VMSS to assert no VMSS is created in check mode
|
||||
azure_rm_virtualmachine_scaleset_facts:
|
||||
azure_rm_virtualmachinescaleset_facts:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS{{ rpfx }}
|
||||
format: curated
|
||||
|
@ -137,7 +137,7 @@
|
|||
- output_scaleset.ansible_facts.azure_vmss | length == 0
|
||||
|
||||
- name: Create VMSS
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS{{ rpfx }}
|
||||
vm_size: Standard_B1s
|
||||
|
@ -170,7 +170,7 @@
|
|||
that: results.changed
|
||||
|
||||
- name: Create VMSS -- test upgrade_policy idempotence and load balancer
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS{{ rpfx }}
|
||||
vm_size: Standard_B1s
|
||||
|
@ -203,7 +203,7 @@
|
|||
that: results.changed
|
||||
|
||||
- name: Retrieve scaleset facts
|
||||
azure_rm_virtualmachine_scaleset_facts:
|
||||
azure_rm_virtualmachinescaleset_facts:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS{{ rpfx }}
|
||||
format: curated
|
||||
|
@ -236,7 +236,7 @@
|
|||
body: "{{ output_scaleset.vmss[0] }}"
|
||||
|
||||
- name: Try to update VMSS using output as input
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ body.resource_group }}"
|
||||
name: "{{ body.name }}"
|
||||
vm_size: "{{ body.vm_size }}"
|
||||
|
@ -382,13 +382,13 @@
|
|||
|
||||
|
||||
- name: Delete VMSS
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS{{ rpfx }}
|
||||
state: absent
|
||||
|
||||
- name: Create VMSS with security group in same resource group, with accelerated networking(check mode).
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS{{ rpfx }}2
|
||||
vm_size: Standard_D3_v2
|
||||
|
@ -412,7 +412,7 @@
|
|||
that: results.changed
|
||||
|
||||
- name: Create VMSS with security group in same resource group, with accelerated networking.
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS{{ rpfx }}2
|
||||
vm_size: Standard_D3_v2
|
||||
|
@ -438,7 +438,7 @@
|
|||
- 'results.ansible_facts.azure_vmss.properties.virtualMachineProfile.networkProfile.networkInterfaceConfigurations.0.properties.networkSecurityGroup != {}'
|
||||
|
||||
- name: Create VMSS with security group in same resource group, with accelerated networking.
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS{{ rpfx }}2
|
||||
vm_size: Standard_D3_v2
|
||||
|
@ -462,7 +462,7 @@
|
|||
- not results.changed
|
||||
|
||||
- name: Create VMSS with security group in same resource group, with accelerated networking.
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS{{ rpfx }}2
|
||||
vm_size: Standard_D3_v2
|
||||
|
@ -486,7 +486,7 @@
|
|||
- results.changed
|
||||
|
||||
- name: update VMSS with security group in different resource group.
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS{{ rpfx }}2
|
||||
vm_size: Standard_B1s
|
||||
|
@ -513,13 +513,13 @@
|
|||
# - '"testNetworkSecurityGroup2" in results.ansible_facts.azure_vmss.properties.virtualMachineProfile.networkProfile.networkInterfaceConfigurations.0.properties.networkSecurityGroup.id'
|
||||
|
||||
- name: Delete VMSS
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS{{ rpfx }}2
|
||||
state: absent
|
||||
|
||||
- name: Fail when instance type is not supported to enable accelerated networking
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testVMSS{{ rpfx }}4
|
||||
vm_size: Standard_B1s
|
||||
|
@ -577,7 +577,7 @@
|
|||
# TODO: Until we have a module to create/delete images this is the best tests
|
||||
# I can do
|
||||
- name: assert error thrown with invalid image dict
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testvm002
|
||||
vm_size: Standard_B1s
|
||||
|
@ -587,7 +587,7 @@
|
|||
failed_when: 'fail_invalid_image_dict.msg != "parameter error: expecting image to contain [publisher, offer, sku, version] or [name, resource_group]"'
|
||||
|
||||
- name: assert error thrown with invalid image type
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testvm002
|
||||
vm_size: Standard_B1s
|
||||
|
@ -597,7 +597,7 @@
|
|||
failed_when: 'fail_invalid_image_type.msg != "parameter error: expecting image to be a string or dict not list"'
|
||||
|
||||
- name: assert error finding missing custom image
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testvm002
|
||||
vm_size: Standard_B1s
|
||||
|
@ -606,7 +606,7 @@
|
|||
failed_when: fail_missing_custom_image.msg != "Error could not find image with name invalid-image"
|
||||
|
||||
- name: assert error finding missing custom image (dict style)
|
||||
azure_rm_virtualmachine_scaleset:
|
||||
azure_rm_virtualmachinescaleset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testvm002
|
||||
vm_size: Standard_B1s
|
Loading…
Reference in a new issue