First batch _facts -> _info rename. (#56822)

This commit is contained in:
Felix Fontein 2019-05-27 18:17:42 +02:00 committed by GitHub
parent 4f8abde081
commit 7a0af34ba9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 91 additions and 65 deletions

View file

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

View file

@ -30,7 +30,7 @@ description:
- Pass the object definition from a source file or inline. See examples for reading
files and using Jinja templates or vault-encrypted files.
- Access to the full range of K8s APIs.
- Use the M(k8s_facts) module to obtain a list of items about an object of type C(kind)
- Use the M(k8s_info) module to obtain a list of items about an object of type C(kind)
- Authenticate using either a config file, certificates, password or token.
- Supports check mode.

View file

@ -96,7 +96,7 @@ EXAMPLES = '''
# Previous task provides the token/api_key, while all other parameters
# are taken from module_defaults
- name: Get a list of all pods from any namespace
k8s_facts:
k8s_info:
api_key: "{{ k8s_auth_results.k8s_auth.api_key }}"
kind: Pod
register: pod_list

View file

@ -14,7 +14,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
'supported_by': 'community'}
DOCUMENTATION = '''
module: k8s_facts
module: k8s_info
short_description: Describe Kubernetes (K8s) objects
@ -28,6 +28,7 @@ description:
- Access to the full range of K8s APIs.
- Authenticate using either a config file, certificates, password or token.
- Supports check mode.
- This module was called C(k8s_facts) before Ansible 2.9. The usage did not change.
options:
api_version:
@ -67,7 +68,7 @@ requirements:
EXAMPLES = '''
- name: Get an existing Service object
k8s_facts:
k8s_info:
api_version: v1
kind: Service
name: web
@ -75,26 +76,26 @@ EXAMPLES = '''
register: web_service
- name: Get a list of all service objects
k8s_facts:
k8s_info:
api_version: v1
kind: Service
namespace: testing
register: service_list
- name: Get a list of all pods from any namespace
k8s_facts:
k8s_info:
kind: Pod
register: pod_list
- name: Search for all Pods labelled app=web
k8s_facts:
k8s_info:
kind: Pod
label_selectors:
- app = web
- tier in (dev, test)
- name: Search for all running pods
k8s_facts:
k8s_info:
kind: Pod
field_selectors:
- status.phase=Running
@ -134,12 +135,14 @@ from ansible.module_utils.k8s.common import KubernetesAnsibleModule, AUTH_ARG_SP
import copy
class KubernetesFactsModule(KubernetesAnsibleModule):
class KubernetesInfoModule(KubernetesAnsibleModule):
def __init__(self, *args, **kwargs):
KubernetesAnsibleModule.__init__(self, *args,
supports_check_mode=True,
**kwargs)
if self._name == 'k8s_facts':
self.deprecate("The 'k8s_facts' module has been renamed to 'k8s_info'", version='2.13')
def execute_module(self):
self.client = self.get_api_client()
@ -169,7 +172,7 @@ class KubernetesFactsModule(KubernetesAnsibleModule):
def main():
KubernetesFactsModule().execute_module()
KubernetesInfoModule().execute_module()
if __name__ == '__main__':

View file

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

View file

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

View file

@ -23,10 +23,11 @@ host_groups:
DOCUMENTATION = '''
---
module: zabbix_group_facts
short_description: Gather facts about Zabbix hostgroup
module: zabbix_group_info
short_description: Gather information about Zabbix hostgroup
description:
- This module allows you to search for Zabbix hostgroup entries.
- This module was called C(zabbix_group_facts) before Ansible 2.9. The usage did not change.
version_added: "2.6"
author:
- "Michael Miko (@RedWhiteMiko)"
@ -46,7 +47,7 @@ extends_documentation_fragment:
EXAMPLES = '''
- name: Get hostgroup info
local_action:
module: zabbix_group_facts
module: zabbix_group_info
server_url: http://monitor.example.com
login_user: username
login_password: password
@ -102,6 +103,8 @@ def main():
),
supports_check_mode=True
)
if module._name == 'zabbix_group_facts':
module.deprecate("The 'zabbix_group_facts' module has been renamed to 'zabbix_group_info'", version='2.13')
if not HAS_ZABBIX_API:
module.fail_json(msg="Missing required zabbix-api module (check docs or install with: pip install zabbix-api)")

View file

@ -24,10 +24,11 @@ hosts:
DOCUMENTATION = '''
---
module: zabbix_host_facts
short_description: Gather facts about Zabbix host
module: zabbix_host_info
short_description: Gather information about Zabbix host
description:
- This module allows you to search for Zabbix host entries.
- This module was called C(zabbix_host_facts) before Ansible 2.9. The usage did not change.
version_added: "2.7"
author:
- "Michael Miko (@RedWhiteMiko)"
@ -68,7 +69,7 @@ extends_documentation_fragment:
EXAMPLES = '''
- name: Get host info
local_action:
module: zabbix_host_facts
module: zabbix_host_info
server_url: http://monitor.example.com
login_user: username
login_password: password
@ -80,7 +81,7 @@ EXAMPLES = '''
- name: Reduce host inventory information to provided keys
local_action:
module: zabbix_host_facts
module: zabbix_host_info
server_url: http://monitor.example.com
login_user: username
login_password: password
@ -185,6 +186,8 @@ def main():
),
supports_check_mode=True
)
if module._name == 'zabbix_host_facts':
module.deprecate("The 'zabbix_host_facts' module has been renamed to 'zabbix_host_info'", version='2.13')
if not HAS_ZABBIX_API:
module.fail_json(msg="Missing required zabbix-api module (check docs or install with: pip install zabbix-api)")

View file

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

View file

@ -12,10 +12,11 @@ ANSIBLE_METADATA = {
}
DOCUMENTATION = '''
module: python_requirements_facts
module: python_requirements_info
short_description: Show python path and assert dependency versions
description:
- Get info about available Python requirements on the target host, including listing required libraries and gathering versions.
- This module was called C(python_requirements_facts) before Ansible 2.9. The usage did not change.
version_added: "2.7"
options:
dependencies:
@ -31,9 +32,9 @@ author:
EXAMPLES = '''
- name: show python lib/site paths
python_requirements_facts:
python_requirements_info:
- name: check for modern boto3 and botocore versions
python_requirements_facts:
python_requirements_info:
dependencies:
- boto3>1.6
- botocore<2
@ -116,6 +117,8 @@ def main():
),
supports_check_mode=True,
)
if module._name == 'python_requirements_facts':
module.deprecate("The 'python_requirements_facts' module has been renamed to 'python_requirements_info'", version='2.13')
if not HAS_DISTUTILS:
module.fail_json(
msg='Could not import "distutils" and "pkg_resources" libraries to introspect python environment.',