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

Change the tags type of the Info module to list and the element type to string #821

Merged
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
1 change: 0 additions & 1 deletion plugins/modules/azure_rm_adpassword_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@

extends_documentation_fragment:
- azure.azcollection.azure
- azure.azcollection.azure_tags

author:
haiyuan_zhang (@haiyuazhang)
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/azure_rm_adserviceprincipal_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

extends_documentation_fragment:
- azure.azcollection.azure
- azure.azcollection.azure_tags

author:
haiyuan_zhang (@haiyuazhang)
Expand Down
4 changes: 3 additions & 1 deletion plugins/modules/azure_rm_aks_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
tags:
description:
- Limit results by providing a list of tags. Format tags as 'key' or 'key:value'.
type: list
elements: str
show_kubeconfig:
description:
- Show kubeconfig of the AKS cluster.
Expand Down Expand Up @@ -86,7 +88,7 @@ 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'),
show_kubeconfig=dict(type='str', choices=['user', 'admin']),
)

Expand Down
7 changes: 5 additions & 2 deletions plugins/modules/azure_rm_applicationsecuritygroup_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
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 @@ -114,7 +116,7 @@ def __init__(self):
name=dict(
type='str'
),
tags=dict(type='list')
tags=dict(type='list', elements='str')
)

self.resource_group = None
Expand All @@ -125,7 +127,8 @@ def __init__(self):

super(AzureRMApplicationSecurityGroupInfo, self).__init__(derived_arg_spec=self.module_arg_spec,
supports_check_mode=True,
supports_tags=False)
supports_tags=False,
facts_module=True)

def exec_module(self, **kwargs):
"""Main module execution method"""
Expand Down
4 changes: 3 additions & 1 deletion plugins/modules/azure_rm_appserviceplan_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
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 @@ -133,7 +135,7 @@ def __init__(self):
self.module_arg_spec = 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)
Expand Down
7 changes: 6 additions & 1 deletion plugins/modules/azure_rm_automationaccount_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
description:
- Limit results by providing a list of tags. Format tags as 'key' or 'key:value'.
type: list
elements: str
list_statistics:
description:
- List statistics details for a automation account.
Expand Down Expand Up @@ -62,6 +63,9 @@
list_statistics: yes
list_usages: yes
list_keys: yes
tags:
- key
- key:value

- name: List automation account in a resource group
azure_rm_automationaccount_info:
Expand Down Expand Up @@ -254,7 +258,8 @@ def __init__(self):
type='str'
),
tags=dict(
type='list'
type='list',
elements='str'
),
list_statistics=dict(
type='bool'
Expand Down
13 changes: 11 additions & 2 deletions plugins/modules/azure_rm_automationrunbook_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@
description:
- Wether retrieve the content of runbook identified by runbook name.
type: bool
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
- azure.azcollection.azure_tags

author:
- Fred Sun (@Fred-sun)
Expand Down Expand Up @@ -198,15 +202,20 @@ def __init__(self):
show_content=dict(
type='bool'
),
tags=dict(
type='list',
elements='str'
)
)
# store the results of the module operation
self.results = dict()
self.resource_group = None
self.name = None
self.tags = None
self.automation_account_name = None
self.show_content = None

super(AzureRMAutomationRunbookInfo, self).__init__(self.module_arg_spec, supports_check_mode=True, supports_tags=True)
super(AzureRMAutomationRunbookInfo, self).__init__(self.module_arg_spec, supports_check_mode=True, supports_tags=False, facts_module=True)

def exec_module(self, **kwargs):

Expand Down
12 changes: 9 additions & 3 deletions plugins/modules/azure_rm_autoscale_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
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 All @@ -45,6 +47,9 @@
- name: List instances of Auto Scale Setting
azure_rm_autoscale_info:
resource_group: myResourceGroup
tags:
- key
- key:value
'''

RETURN = '''
Expand Down Expand Up @@ -212,7 +217,8 @@ def __init__(self):
type='str'
),
tags=dict(
type='list'
type='list',
elements='str'
)
)
# store the results of the module operation
Expand All @@ -221,7 +227,7 @@ def __init__(self):
self.name = None
self.tags = None

super(AzureRMAutoScaleInfo, self).__init__(self.module_arg_spec, supports_check_mode=True, supports_tags=False)
super(AzureRMAutoScaleInfo, self).__init__(self.module_arg_spec, supports_check_mode=True, supports_tags=False, facts_module=True)

def exec_module(self, **kwargs):

Expand All @@ -242,7 +248,7 @@ def get(self):
result = []
try:
instance = self.monitor_autoscale_settings_client.autoscale_settings.get(self.resource_group, self.name)
result = [auto_scale_to_dict(instance)]
result = [auto_scale_to_dict(instance) if self.has_tags(instance.tags, self.tags) else None]
except Exception as ex:
self.log('Could not get facts for autoscale {0} - {1}.'.format(self.name, str(ex)))
return result
Expand Down
11 changes: 9 additions & 2 deletions plugins/modules/azure_rm_availabilityset_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@
name:
description:
- Limit results to a specific availability set.
type: str
resource_group:
description:
- The resource group to search for the desired availability set.
type: str
tags:
description:
- List of tags to be matched.
- 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 All @@ -45,6 +49,9 @@
- name: Get facts for all availability sets in a specific resource group
azure_rm_availabilityset_info:
resource_group: myResourceGroup
tags:
- key
- key:value

'''

Expand Down Expand Up @@ -120,7 +127,7 @@ 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(
Expand Down
10 changes: 9 additions & 1 deletion plugins/modules/azure_rm_cdnendpoint_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
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 All @@ -48,6 +50,9 @@
azure_rm_cdnendpoint_info:
resource_group: myResourceGroup
profile_name: myCDNProfile
tags:
- key
- key:value

- name: Get facts of specific CDN endpoint
azure_rm_cdnendpoint_info:
Expand Down Expand Up @@ -191,7 +196,10 @@ def __init__(self):
type='str',
required=True
),
tags=dict(type='list')
tags=dict(
type='list',
elements='str'
)
)

self.results = dict(
Expand Down
4 changes: 3 additions & 1 deletion plugins/modules/azure_rm_cdnprofile_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
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 @@ -133,7 +135,7 @@ 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(
Expand Down
13 changes: 9 additions & 4 deletions plugins/modules/azure_rm_containerinstance_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
tags:
description:
- Limit results by providing of tags. Format tags 'key:value'.
type: dict
type: list
elements: str

extends_documentation_fragment:
- azure.azcollection.azure
- azure.azcollection.azure_tags

author:
- Zim Kalinowski (@zikalino)
Expand All @@ -49,6 +49,9 @@
- name: List Container Instances in a specified resource group name
azure_rm_containerinstance_info:
resource_group: myResourceGroup
tags:
- key
- key:value
'''

RETURN = '''
Expand Down Expand Up @@ -218,7 +221,8 @@ def __init__(self):
type='str'
),
tags=dict(
type='dict'
type='list',
elements='str'
)
)
# store the results of the module operation
Expand All @@ -231,7 +235,8 @@ def __init__(self):

super(AzureRMContainerInstanceInfo, self).__init__(self.module_arg_spec,
supports_check_mode=True,
supports_tags=True)
supports_tags=False,
facts_module=True)

def exec_module(self, **kwargs):

Expand Down
17 changes: 15 additions & 2 deletions plugins/modules/azure_rm_containerregistry_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@
- Retrieve credentials for container registry.
type: bool
default: no
tags:
description:
- List of tags to be matched.
- 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
- azure.azcollection.azure_tags

author:
- Zim Kalinowski (@zikalino)
Expand All @@ -49,6 +54,9 @@
- name: List instances of Registry
azure_rm_containerregistry_info:
resource_group: myResourceGroup
tags:
- key
- key:value
'''

RETURN = '''
Expand Down Expand Up @@ -157,6 +165,10 @@ def __init__(self):
retrieve_credentials=dict(
type='bool',
default=False
),
tags=dict(
type='list',
elements='str'
)
)
# store the results of the module operation
Expand All @@ -166,8 +178,9 @@ def __init__(self):
self.resource_group = None
self.name = None
self.retrieve_credentials = False
self.tags = None

super(AzureRMContainerRegistryInfo, self).__init__(self.module_arg_spec, supports_check_mode=True, supports_tags=True, facts_module=True)
super(AzureRMContainerRegistryInfo, self).__init__(self.module_arg_spec, supports_check_mode=True, supports_tags=False, facts_module=True)

def exec_module(self, **kwargs):

Expand Down
Loading