Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BugFix : Fixed documentation issue for azure_rm_loadbalancer_info #719

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 51 additions & 7 deletions plugins/modules/azure_rm_loadbalancer_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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()
)
Expand Down
2 changes: 0 additions & 2 deletions tests/sanity/ignore-2.10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tests/sanity/ignore-2.11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tests/sanity/ignore-2.12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tests/sanity/ignore-2.13.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tests/sanity/ignore-2.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down