From 0a9c58f866d233a704378d797fbf683aeb7b467e Mon Sep 17 00:00:00 2001 From: Zim Kalinowski Date: Thu, 16 Aug 2018 14:45:36 +0800 Subject: [PATCH] adjusting curated response format, notification of raw format depreciation. (#43587) --- .../cloud/azure/azure_rm_virtualmachine_scaleset_facts.py | 7 ++++++- .../azure_rm_virtualmachine_scaleset/tasks/main.yml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset_facts.py index 06ed5a6deb..c4dadf540e 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset_facts.py @@ -38,6 +38,7 @@ options: - 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. - 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' choices: - 'curated' @@ -70,7 +71,7 @@ EXAMPLES = ''' ''' RETURN = ''' -azure_vmss: +vmss: description: List of virtual machine scale sets returned: always type: complex @@ -345,6 +346,10 @@ class AzureRMVirtualMachineScaleSetFacts(AzureRMModuleBase): self.results['ansible_facts']['azure_vmss'][index] = updated + # proper result format we want to support in the future + # dropping 'ansible_facts' and shorter name 'vmss' + self.results['vmss'] = self.results['ansible_facts']['azure_vmss'] + return self.results def get_item(self): diff --git a/test/integration/targets/azure_rm_virtualmachine_scaleset/tasks/main.yml b/test/integration/targets/azure_rm_virtualmachine_scaleset/tasks/main.yml index 914533cb2c..4502dfd25d 100644 --- a/test/integration/targets/azure_rm_virtualmachine_scaleset/tasks/main.yml +++ b/test/integration/targets/azure_rm_virtualmachine_scaleset/tasks/main.yml @@ -100,7 +100,7 @@ - name: Get scaleset body set_fact: - body: "{{ output_scaleset.ansible_facts.azure_vmss[0] }}" + body: "{{ output_scaleset.vmss[0] }}" - name: Try to update VMSS using output as input azure_rm_virtualmachine_scaleset: