From cfa1d4ec0543f142b3fcf58c9da8ed67113ba2c1 Mon Sep 17 00:00:00 2001 From: Peter Murray <681306+peter-murray@users.noreply.github.com> Date: Fri, 20 May 2022 10:46:02 +0000 Subject: [PATCH] Fixing issue #856 with deployment info for a resource group and adding supporting test --- plugins/modules/azure_rm_deployment_info.py | 2 +- .../targets/azure_rm_deployment/tasks/main.yml | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/modules/azure_rm_deployment_info.py b/plugins/modules/azure_rm_deployment_info.py index 8cb8cd1ad..7ad603006 100644 --- a/plugins/modules/azure_rm_deployment_info.py +++ b/plugins/modules/azure_rm_deployment_info.py @@ -182,7 +182,7 @@ def list(self): response = None results = [] try: - response = self.rm_client.deployments.list(self.resource_group) + response = self.rm_client.deployments.list_by_resource_group(self.resource_group) self.log("Response : {0}".format(response)) except CloudError as e: self.log('Could not get facts for Deployment.') diff --git a/tests/integration/targets/azure_rm_deployment/tasks/main.yml b/tests/integration/targets/azure_rm_deployment/tasks/main.yml index bbe5c98ee..7e83a4c28 100644 --- a/tests/integration/targets/azure_rm_deployment/tasks/main.yml +++ b/tests/integration/targets/azure_rm_deployment/tasks/main.yml @@ -46,7 +46,14 @@ groupname: azure_vms with_items: "{{ output.deployment.instances }}" -- name: Get Deployment Facts +- name: Get Deployment Facts for Resource Group + azure_rm_deployment_info: + resource_group: "{{ resource_group }}" + register: output +- debug: + var: output + +- name: Get Deployment Facts for named deployment azure_rm_deployment_info: resource_group: "{{ resource_group }}" name: "{{ dns_label }}"