Rename Azure modules: facts -> info (#60987)

This commit is contained in:
smile37773 2019-08-28 04:44:57 +08:00 committed by Zim Kalinowski
parent 2db4e044ab
commit 5438013191
19 changed files with 124 additions and 61 deletions

View file

@ -0,0 +1,7 @@
minor_changes:
- The ``azure_rm_aks_facts`` module has been renamed to ``azure_rm_aks_info``.
- The ``azure_rm_aksversion_facts`` module has been renamed to ``azure_rm_aksversion_info``.
- The ``azure_rm_applicationsecuritygroup_facts`` module has been renamed to ``azure_rm_applicationsecuritygroup_info``.
- The ``azure_rm_appserviceplan_facts`` module has been renamed to ``azure_rm_appserviceplan_info``.
- The ``azure_rm_autoscale_facts`` module has been renamed to ``azure_rm_autoscale_info``.
- The ``azure_rm_availabilityset_facts`` module has been renamed to ``azure_rm_availabilityset_info``.

View file

@ -468,6 +468,12 @@ be removed in Ansible 2.13. Please update update your playbooks accordingly.
* The ``xenserver_guest_facts`` module was renamed to :ref:`xenserver_guest_info <xenserver_guest_info_module>`.
* The ``zabbix_group_facts`` module was renamed to :ref:`zabbix_group_info <zabbix_group_info_module>`.
* The ``zabbix_host_facts`` module was renamed to :ref:`zabbix_host_info <zabbix_host_info_module>`.
* The ``azure_rm_aks_facts`` module was renamed to :ref:`azure_rm_aks_info <azure_rm_aks_info_module>`.
* The ``azure_rm_aksversion_facts`` module was renamed to :ref:`azure_rm_aksversion_info <azure_rm_aksversion_info_module>`.
* The ``azure_rm_applicationsecuritygroup_facts`` module was renamed to :ref:`azure_rm_applicationsecuritygroup_info <azure_rm_applicationsecuritygroup_info_module>`.
* The ``azure_rm_appserviceplan_facts`` module was renamed to :ref:`azure_rm_appserviceplan_info <azure_rm_appserviceplan_info_module>`.
* The ``azure_rm_autoscale_facts`` module was renamed to :ref:`azure_rm_autoscale_info <azure_rm_autoscale_info_module>`.
* The ``azure_rm_availabilityset_facts`` module was renamed to :ref:`azure_rm_availabilityset <azure_rm_availabilityset_info_module>`.
Noteworthy module changes

View file

@ -0,0 +1 @@
azure_rm_aks_info.py

View file

@ -0,0 +1 @@
azure_rm_aksversion_info.py

View file

@ -0,0 +1 @@
azure_rm_applicationsecuritygroup_info.py

View file

@ -0,0 +1 @@
azure_rm_appserviceplan_info.py

View file

@ -0,0 +1 @@
azure_rm_autoscale_info.py

View file

@ -0,0 +1 @@
azure_rm_availabilityset_info.py

View file

@ -14,9 +14,9 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: azure_rm_aks_facts
module: azure_rm_aks_info
version_added: "2.6"
version_added: "2.9"
short_description: Get Azure Kubernetes Service facts
@ -51,15 +51,15 @@ author:
EXAMPLES = '''
- name: Get facts for one Azure Kubernetes Service
azure_rm_aks_facts:
azure_rm_aks_info:
name: Testing
resource_group: myResourceGroup
- name: Get facts for all Azure Kubernetes Services
azure_rm_aks_facts:
azure_rm_aks_info:
- name: Get facts by tags
azure_rm_aks_facts:
azure_rm_aks_info:
tags:
- testing
'''
@ -71,6 +71,7 @@ azure_aks:
type: list
'''
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try:
@ -83,7 +84,7 @@ except Exception:
AZURE_OBJECT_CLASS = 'managedClusters'
class AzureRMManagedClusterFacts(AzureRMModuleBase):
class AzureRMManagedClusterInfo(AzureRMModuleBase):
"""Utility class to get Azure Kubernetes Service facts"""
def __init__(self):
@ -106,7 +107,12 @@ class AzureRMManagedClusterFacts(AzureRMModuleBase):
self.tags = None
self.show_kubeconfig = None
super(AzureRMManagedClusterFacts, self).__init__(
module = AnsibleModule(self.module_args)
is_old_facts = module._name == 'azure_rm_aks_facts'
if is_old_facts:
module.deprecate("The 'azure_rm_aks_facts' module has been renamed to 'azure_rm_aks_info'", version='2.13')
super(AzureRMManagedClusterInfo, self).__init__(
derived_arg_spec=self.module_args,
supports_tags=False,
facts_module=True
@ -180,7 +186,7 @@ class AzureRMManagedClusterFacts(AzureRMModuleBase):
def main():
"""Main module execution code path"""
AzureRMManagedClusterFacts()
AzureRMManagedClusterInfo()
if __name__ == '__main__':

View file

@ -14,9 +14,9 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: azure_rm_aksversion_facts
module: azure_rm_aksversion_info
version_added: "2.8"
version_added: "2.9"
short_description: Get available kubernetes versions supported by Azure Kubernetes Service
@ -41,10 +41,10 @@ author:
EXAMPLES = '''
- name: Get available versions for AKS in location eastus
azure_rm_aksversion_facts:
azure_rm_aksversion_info:
location: eastus
- name: Get available versions an AKS can be upgrade to
azure_rm_aksversion_facts:
azure_rm_aksversion_info:
location: eastis
version: 1.11.6
'''
@ -56,6 +56,7 @@ azure_aks_versions:
type: list
'''
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try:
@ -83,6 +84,11 @@ class AzureRMAKSVersion(AzureRMModuleBase):
self.location = None
self.version = None
module = AnsibleModule(self.module_args)
is_old_facts = module._name == 'azure_rm_aksversion_facts'
if is_old_facts:
module.deprecate("The 'azure_rm_aksversion_facts' module has been renamed to 'azure_rm_aksversion_info'", version='2.13')
super(AzureRMAKSVersion, self).__init__(
derived_arg_spec=self.module_args,
supports_tags=False,

View file

@ -15,8 +15,8 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: azure_rm_applicationsecuritygroup_facts
version_added: "2.8"
module: azure_rm_applicationsecuritygroup_info
version_added: "2.9"
short_description: Get Azure Application Security Group facts
description:
- Get facts of Azure Application Security Group.
@ -42,14 +42,14 @@ author:
EXAMPLES = '''
- name: List application security groups in specific resource group
azure_rm_applicationsecuritygroup_facts:
azure_rm_applicationsecuritygroup_info:
resource_group: myResourceGroup
- name: List application security groups in specific subscription
azure_rm_applicationsecuritygroup_facts:
azure_rm_applicationsecuritygroup_info:
- name: Get application security group by name
azure_rm_applicationsecuritygroup_facts:
azure_rm_applicationsecuritygroup_info:
resource_group: myResourceGroup
name: myApplicationSecurityGroup
tags:
@ -89,6 +89,7 @@ applicationsecuritygroups:
sample: Succeeded
'''
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try:
@ -110,7 +111,7 @@ def applicationsecuritygroup_to_dict(asg):
)
class AzureRMApplicationSecurityGroupFacts(AzureRMModuleBase):
class AzureRMApplicationSecurityGroupInfo(AzureRMModuleBase):
def __init__(self):
self.module_arg_spec = dict(
@ -129,9 +130,15 @@ class AzureRMApplicationSecurityGroupFacts(AzureRMModuleBase):
self.results = dict(changed=False)
super(AzureRMApplicationSecurityGroupFacts, self).__init__(derived_arg_spec=self.module_arg_spec,
supports_check_mode=False,
supports_tags=False)
module = AnsibleModule(self.module_arg_spec)
is_old_facts = module._name == 'azure_rm_applicationsecuritygroup_facts'
if is_old_facts:
module.deprecate("The 'azure_rm_applicationsecuritygroup_facts' module has been renamed to 'azure_rm_applicationsecuritygroup_info'",
version='2.13')
super(AzureRMApplicationSecurityGroupInfo, self).__init__(derived_arg_spec=self.module_arg_spec,
supports_check_mode=False,
supports_tags=False)
def exec_module(self, **kwargs):
"""Main module execution method"""
@ -217,7 +224,7 @@ class AzureRMApplicationSecurityGroupFacts(AzureRMModuleBase):
def main():
"""Main execution"""
AzureRMApplicationSecurityGroupFacts()
AzureRMApplicationSecurityGroupInfo()
if __name__ == '__main__':

View file

@ -15,9 +15,9 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: azure_rm_appserviceplan_facts
module: azure_rm_appserviceplan_info
version_added: "2.7"
version_added: "2.9"
short_description: Get azure app service plan facts
@ -44,16 +44,16 @@ author:
EXAMPLES = '''
- name: Get facts for app service plan by name
azure_rm_appserviceplan_facts:
azure_rm_appserviceplan_info:
resource_group: myResourceGroup
name: myAppServicePlan
- name: Get azure_rm_appserviceplan_facts for app service plan in resource group
azure_rm_appserviceplan_facts:
azure_rm_appserviceplan_info:
resource_group: myResourceGroup
- name: Get facts for app service plan with tags
azure_rm_appserviceplan_facts:
azure_rm_appserviceplan_info:
tags:
- testtag
- foo:bar
@ -126,12 +126,13 @@ except Exception:
# This is handled in azure_rm_common
pass
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.azure_rm_common import AzureRMModuleBase
AZURE_OBJECT_CLASS = 'AppServicePlan'
class AzureRMAppServicePlanFacts(AzureRMModuleBase):
class AzureRMAppServicePlanInfo(AzureRMModuleBase):
def __init__(self):
@ -148,9 +149,14 @@ class AzureRMAppServicePlanFacts(AzureRMModuleBase):
self.tags = None
self.info_level = None
super(AzureRMAppServicePlanFacts, self).__init__(self.module_arg_spec,
supports_tags=False,
facts_module=True)
module = AnsibleModule(self.module_arg_spec)
is_old_facts = module._name == 'azure_rm_appserviceplan_facts'
if is_old_facts:
module.deprecate("The 'azure_rm_appserviceplan_facts' module has been renamed to 'azure_rm_appserviceplan_info'", version='2.13')
super(AzureRMAppServicePlanInfo, self).__init__(self.module_arg_spec,
supports_tags=False,
facts_module=True)
def exec_module(self, **kwargs):
@ -230,7 +236,7 @@ class AzureRMAppServicePlanFacts(AzureRMModuleBase):
def main():
AzureRMAppServicePlanFacts()
AzureRMAppServicePlanInfo()
if __name__ == '__main__':

View file

@ -15,8 +15,8 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: azure_rm_autoscale_facts
version_added: "2.7"
module: azure_rm_autoscale_info
version_added: "2.9"
short_description: Get Azure Auto Scale Setting facts
description:
- Get facts of Auto Scale Setting.
@ -43,12 +43,12 @@ author:
EXAMPLES = '''
- name: Get instance of Auto Scale Setting
azure_rm_autoscale_facts:
azure_rm_autoscale_info:
resource_group: myResourceGroup
name: auto_scale_name
- name: List instances of Auto Scale Setting
azure_rm_autoscale_facts:
azure_rm_autoscale_info:
resource_group: myResourceGroup
'''
@ -114,6 +114,7 @@ autoscales:
'''
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.azure_rm_common import AzureRMModuleBase
from ansible.module_utils._text import to_native
@ -206,7 +207,7 @@ def notification_to_dict(notification):
webhooks=[to_native(w.service_url) for w in notification.webhooks or []])
class AzureRMAutoScaleFacts(AzureRMModuleBase):
class AzureRMAutoScaleInfo(AzureRMModuleBase):
def __init__(self):
# define user inputs into argument
self.module_arg_spec = dict(
@ -226,7 +227,13 @@ class AzureRMAutoScaleFacts(AzureRMModuleBase):
self.resource_group = None
self.name = None
self.tags = None
super(AzureRMAutoScaleFacts, self).__init__(self.module_arg_spec, supports_tags=False)
module = AnsibleModule(self.module_arg_spec)
is_old_facts = module._name == 'azure_rm_autoscale_facts'
if is_old_facts:
module.deprecate("The 'azure_rm_autoscale_facts' module has been renamed to 'azure_rm_autoscale_info'", version='2.13')
super(AzureRMAutoScaleInfo, self).__init__(self.module_arg_spec, supports_tags=False)
def exec_module(self, **kwargs):
for key in list(self.module_arg_spec):
@ -258,7 +265,7 @@ class AzureRMAutoScaleFacts(AzureRMModuleBase):
def main():
AzureRMAutoScaleFacts()
AzureRMAutoScaleInfo()
if __name__ == '__main__':

View file

@ -13,9 +13,9 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: azure_rm_availabilityset_facts
module: azure_rm_availabilityset_info
version_added: "2.4"
version_added: "2.9"
short_description: Get Azure Availability Set facts
@ -42,12 +42,12 @@ author:
EXAMPLES = '''
- name: Get facts for one availability set
azure_rm_availabilityset_facts:
azure_rm_availabilityset_info:
name: Testing
resource_group: myResourceGroup
- name: Get facts for all availability sets in a specific resource group
azure_rm_availabilityset_facts:
azure_rm_availabilityset_info:
resource_group: myResourceGroup
'''
@ -105,6 +105,7 @@ azure_availabilityset:
sample: { env: sandbox }
'''
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try:
@ -116,7 +117,7 @@ except Exception:
AZURE_OBJECT_CLASS = 'AvailabilitySet'
class AzureRMAvailabilitySetFacts(AzureRMModuleBase):
class AzureRMAvailabilitySetInfo(AzureRMModuleBase):
"""Utility class to get availability set facts"""
def __init__(self):
@ -138,7 +139,12 @@ class AzureRMAvailabilitySetFacts(AzureRMModuleBase):
self.resource_group = None
self.tags = None
super(AzureRMAvailabilitySetFacts, self).__init__(
module = AnsibleModule(self.module_args)
is_old_facts = module._name == 'azure_rm_availabilityset_facts'
if is_old_facts:
module.deprecate("The 'azure_rm_availabilityset_facts' module has been renamed to 'azure_rm_availabilityset_info'", version='2.13')
super(AzureRMAvailabilitySetInfo, self).__init__(
derived_arg_spec=self.module_args,
supports_tags=False,
facts_module=True
@ -205,7 +211,7 @@ class AzureRMAvailabilitySetFacts(AzureRMModuleBase):
def main():
"""Main module execution code path"""
AzureRMAvailabilitySetFacts()
AzureRMAvailabilitySetInfo()
if __name__ == '__main__':

View file

@ -2,7 +2,7 @@
rpfx: "{{ resource_group | hash('md5') | truncate(8, True, '') }}"
- name: Find available k8s version
azure_rm_aksversion_facts:
azure_rm_aksversion_info:
location: eastus
register: versions
@ -27,7 +27,7 @@
check_mode: yes
- name: Check there is no AKS created
azure_rm_aks_facts:
azure_rm_aks_info:
name: "aks{{ rpfx }}"
resource_group: "{{ resource_group }}"
register: fact
@ -64,7 +64,7 @@
- output.provisioning_state == 'Succeeded'
- name: Get AKS fact
azure_rm_aks_facts:
azure_rm_aks_info:
name: "aks{{ rpfx }}"
resource_group: "{{ resource_group }}"
register: fact
@ -100,7 +100,7 @@
- not output.changed
- name: Get available version
azure_rm_aksversion_facts:
azure_rm_aksversion_info:
location: eastus
version: "{{ versions.azure_aks_versions[0] }}"
register: version1
@ -165,7 +165,7 @@
- not output.changed
- name: Get AKS fact
azure_rm_aks_facts:
azure_rm_aks_info:
name: "aks{{ rpfx }}"
resource_group: "{{ resource_group }}"
show_kubeconfig: user
@ -202,7 +202,7 @@
- not output.changed
- name: Get AKS fact
azure_rm_aks_facts:
azure_rm_aks_info:
name: "aks{{ rpfx }}"
resource_group: "{{ resource_group }}"
register: fact

View file

@ -33,7 +33,7 @@
- output.id
- name: get app service plan by name
azure_rm_appserviceplan_facts:
azure_rm_appserviceplan_info:
resource_group: "{{ linux_plan_resource_group }}"
name: "{{ linux_plan_name }}1"
register: output

View file

@ -1,4 +1,4 @@
cloud/azure
shippable/azure/group2
destructive
azure_rm_availalibityset_facts
azure_rm_availalibityset_info

View file

@ -103,7 +103,7 @@
# azure_rm_availabilityset_facts tests
#
- name: Get facts for created availability set
azure_rm_availabilityset_facts:
azure_rm_availabilityset_info:
name: myavailabilityset2
resource_group: "{{ resource_group }}"
register: results

View file

@ -1091,19 +1091,25 @@ lib/ansible/modules/cloud/azure/azure_rm_aks.py validate-modules:E322
lib/ansible/modules/cloud/azure/azure_rm_aks.py validate-modules:E324
lib/ansible/modules/cloud/azure/azure_rm_aks.py validate-modules:E326
lib/ansible/modules/cloud/azure/azure_rm_aks.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_aks_facts.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_aksversion_facts.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_aks_info.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_aks_info.py validate-modules:E323
lib/ansible/modules/cloud/azure/azure_rm_aksversion_info.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_aksversion_info.py validate-modules:E323
lib/ansible/modules/cloud/azure/azure_rm_appgateway.py validate-modules:E326
lib/ansible/modules/cloud/azure/azure_rm_appgateway.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_applicationsecuritygroup.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_applicationsecuritygroup_facts.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_applicationsecuritygroup_info.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_applicationsecuritygroup_info.py validate-modules:E323
lib/ansible/modules/cloud/azure/azure_rm_appserviceplan.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_appserviceplan_facts.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_appserviceplan_info.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_appserviceplan_info.py validate-modules:E323
lib/ansible/modules/cloud/azure/azure_rm_autoscale.py validate-modules:E322
lib/ansible/modules/cloud/azure/azure_rm_autoscale.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_autoscale_facts.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_autoscale_info.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_autoscale_info.py validate-modules:E323
lib/ansible/modules/cloud/azure/azure_rm_availabilityset.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_availabilityset_facts.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_availabilityset_info.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_availabilityset_info.py validate-modules:E323
lib/ansible/modules/cloud/azure/azure_rm_azurefirewall.py validate-modules:E322
lib/ansible/modules/cloud/azure/azure_rm_azurefirewall.py validate-modules:E337
lib/ansible/modules/cloud/azure/azure_rm_azurefirewall.py validate-modules:E340