diff --git a/plugins/modules/azure_rm_loadbalancer_info.py b/plugins/modules/azure_rm_loadbalancer_info.py index 38d174401..a9fd5d45e 100644 --- a/plugins/modules/azure_rm_loadbalancer_info.py +++ b/plugins/modules/azure_rm_loadbalancer_info.py @@ -24,12 +24,16 @@ name: description: - Limit results to a specific resource group. + type: str resource_group: description: - The resource group to search for the desired load balancer. + type: str tags: description: - Limit results by providing a list of tags. Format tags as 'key' or 'key:value'. + type: list + elements: str extends_documentation_fragment: - azure.azcollection.azure @@ -58,11 +62,53 @@ ''' RETURN = ''' -azure_loadbalancers: +loadbalancers: description: - - List of load balancer dicts. + - Gets a list of load balancers. returned: always type: list + elements: dict + sample: [ + { + "etag": "1c83ade9-9dee-4027-860a-d5fabacc184f", + "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myAzureResourceGroup/providers/ + Microsoft.Network/loadBalancers/testloadbalancer1", + "location": "centralindia", + "name": "testloadbalancer1", + "properties": { + "backendAddressPools": [], + "frontendIPConfigurations": [ + { + "etag": "1c83ade9-9dee-4027-860a-d5fabacc184f", + "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myAzureResourceGroup/ + providers/Microsoft.Network/loadBalancers/testloadbalancer1/ + frontendIPConfigurations/frontendipconf0", + "name": "frontendipconf0", + "properties": { + "privateIPAllocationMethod": "Dynamic", + "provisioningState": "Succeeded", + "publicIPAddress": { + "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ + myAzureResourceGroup/providers/Microsoft.Network/publicIPAddresses/testpip" + } + }, + "type": "Microsoft.Network/loadBalancers/frontendIPConfigurations" + } + ], + "inboundNatPools": [], + "inboundNatRules": [], + "loadBalancingRules": [], + "outboundRules": [], + "probes": [], + "provisioningState": "Succeeded", + "resourceGuid": "0b31ab3e-7c55-438d-92a0-5acdc99b5277" + }, + "sku": { + "name": "Standard" + }, + "type": "Microsoft.Network/loadBalancers" + } + ] ''' from ansible_collections.azure.azcollection.plugins.module_utils.azure_rm_common import AzureRMModuleBase @@ -85,14 +131,12 @@ def __init__(self): self.module_args = dict( name=dict(type='str'), resource_group=dict(type='str'), - tags=dict(type='list') + tags=dict(type='list', elements='str') ) self.results = dict( changed=False, - ansible_info=dict( - azure_loadbalancers=[] - ) + loadbalancers=[] ) self.name = None @@ -115,7 +159,7 @@ def exec_module(self, **kwargs): for key in self.module_args: setattr(self, key, kwargs[key]) - self.results['ansible_info']['azure_loadbalancers'] = ( + self.results['loadbalancers'] = ( self.get_item() if self.name else self.list_items() ) diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 73a5a018e..9067db729 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -308,8 +308,6 @@ plugins/modules/azure_rm_devtestlabschedule_info.py validate-modules:return-synt plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:parameter-list-no-elements plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_loadbalancer_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loadbalancer_info.py validate-modules:parameter-list-no-elements plugins/modules/azure_rm_lock_info.py validate-modules:doc-required-mismatch plugins/modules/azure_rm_cdnprofile_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_cdnprofile_info.py validate-modules:parameter-list-no-elements diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index 73a5a018e..9067db729 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -308,8 +308,6 @@ plugins/modules/azure_rm_devtestlabschedule_info.py validate-modules:return-synt plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:parameter-list-no-elements plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_loadbalancer_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loadbalancer_info.py validate-modules:parameter-list-no-elements plugins/modules/azure_rm_lock_info.py validate-modules:doc-required-mismatch plugins/modules/azure_rm_cdnprofile_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_cdnprofile_info.py validate-modules:parameter-list-no-elements diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 73a5a018e..9067db729 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -308,8 +308,6 @@ plugins/modules/azure_rm_devtestlabschedule_info.py validate-modules:return-synt plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:parameter-list-no-elements plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_loadbalancer_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loadbalancer_info.py validate-modules:parameter-list-no-elements plugins/modules/azure_rm_lock_info.py validate-modules:doc-required-mismatch plugins/modules/azure_rm_cdnprofile_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_cdnprofile_info.py validate-modules:parameter-list-no-elements diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index f3399dd22..50c20e5d4 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -307,8 +307,6 @@ plugins/modules/azure_rm_devtestlabschedule_info.py validate-modules:return-synt plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:parameter-list-no-elements plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:return-syntax-error -plugins/modules/azure_rm_loadbalancer_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loadbalancer_info.py validate-modules:parameter-list-no-elements plugins/modules/azure_rm_lock_info.py validate-modules:doc-required-mismatch plugins/modules/azure_rm_cdnprofile_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_cdnprofile_info.py validate-modules:parameter-list-no-elements diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 3f38b6500..715047588 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -157,7 +157,6 @@ plugins/modules/azure_rm_cosmosdbaccount.py validate-modules:nonexistent-paramet plugins/modules/azure_rm_cosmosdbaccount_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_devtestlabschedule.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_hdinsightcluster_info.py validate-modules:parameter-type-not-in-doc -plugins/modules/azure_rm_loadbalancer_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_loganalyticsworkspace_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_cdnprofile_info.py validate-modules:parameter-type-not-in-doc plugins/modules/azure_rm_azurefirewall.py validate-modules:missing-suboption-docs