1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Document attributes (_info and _facts modules for now) (#5481)

* Add attributes docs fragment.

* Use attributes for _info and _facts modules.
This commit is contained in:
Felix Fontein 2022-11-06 21:16:43 +01:00 committed by GitHub
parent 8de0221ae6
commit ac6ac73276
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
73 changed files with 319 additions and 49 deletions

View file

@ -0,0 +1,89 @@
# -*- coding: utf-8 -*-
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class ModuleDocFragment(object):
# Standard documentation fragment
DOCUMENTATION = r'''
options: {}
attributes:
check_mode:
description: Can run in C(check_mode) and return changed status prediction without modifying target.
diff_mode:
description: Will return details on what has changed (or possibly needs changing in C(check_mode)), when in diff mode.
'''
# platform:
# description: Target OS/families that can be operated against.
# support: N/A
# Should be used together with the standard fragment
INFO_MODULE = r'''
options: {}
attributes:
check_mode:
support: full
details:
- This action does not modify state.
diff_mode:
support: N/A
details:
- This action does not modify state.
'''
CONN = r'''
options: {}
attributes:
become:
description: Is usable alongside C(become) keywords.
connection:
description: Uses the target's configured connection information to execute code on it.
delegation:
description: Can be used in conjunction with C(delegate_to) and related keywords.
'''
FACTS = r'''
options: {}
attributes:
facts:
description: Action returns an C(ansible_facts) dictionary that will update existing host facts.
'''
# Should be used together with the standard fragment and the FACTS fragment
FACTS_MODULE = r'''
options: {}
attributes:
check_mode:
support: full
details:
- This action does not modify state.
diff_mode:
support: N/A
details:
- This action does not modify state.
facts:
support: full
'''
FILES = r'''
options: {}
attributes:
safe_file_operations:
description: Uses Ansible's strict file operation functions to ensure proper permissions and avoid data corruption.
'''
FLOW = r'''
options: {}
attributes:
action:
description: Indicates this has a corresponding action plugin so some parts of the options can be executed on the controller.
async:
description: Supports being used with the C(async) keyword.
'''

View file

@ -60,6 +60,8 @@ requirements:
- "footmark >= 1.13.0"
extends_documentation_fragment:
- community.general.alicloud
- community.general.attributes
- community.general.attributes.info_module
'''
EXAMPLES = '''

View file

@ -15,6 +15,10 @@ short_description: Retrieve facts of cloud-init.
description:
- Gathers facts by reading the status.json and result.json of cloud-init.
author: René Moser (@resmo)
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.facts
- community.general.attributes.facts_module
options:
filter:
description:

View file

@ -19,6 +19,10 @@ version_added: "4.2.0"
description: Retrieve existing records and domains from DNSimple API.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
name:
description:

View file

@ -15,6 +15,9 @@ short_description: Retrieve GConf configurations
version_added: 5.1.0
description:
- This module allows retrieving application preferences from the GConf database, with the help of C(gconftool-2).
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
key:
description:

View file

@ -17,6 +17,9 @@ description:
- This module was called C(github_webhook_facts) before Ansible 2.9. The usage did not change.
requirements:
- "PyGithub >= 1.3.5"
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
repository:
description:

View file

@ -21,6 +21,9 @@ description:
- This module requires the C(hpilo) python module.
- This module was called C(hpilo_facts) before Ansible 2.9, returning C(ansible_facts).
Note that the M(community.general.hpilo_info) module no longer returns C(ansible_facts)!
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
host:
description:

View file

@ -18,6 +18,9 @@ description:
- For use with Dell EMC iDRAC operations that require Redfish OEM extensions.
- This module was called C(idrac_redfish_facts) before Ansible 2.9, returning C(ansible_facts).
Note that the M(community.general.idrac_redfish_info) module no longer returns C(ansible_facts)!
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
category:
required: true

View file

@ -15,6 +15,9 @@ description:
- Builds Redfish URIs locally and sends them to iLO to
get information back.
- For use with HPE iLO operations that require Redfish OEM extensions.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
category:
required: true

View file

@ -17,6 +17,10 @@ description:
- If behind NAT and need to know the public IP of your internet gateway.
author:
- René Moser (@resmo)
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.facts
- community.general.attributes.facts_module
options:
api_url:
description:

View file

@ -16,6 +16,10 @@ short_description: "Retrieve IP geolocation facts of a host's IP address"
description:
- "Gather IP geolocation facts of a host's IP address using ipinfo.io API"
author: "Aleksei Kostiuk (@akostyuk)"
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.facts
- community.general.attributes.facts_module
options:
timeout:
description:

View file

@ -18,6 +18,9 @@ description:
- This module was called C(jenkins_job_info) before Ansible 2.9. The usage did not change.
requirements:
- "python-jenkins >= 0.4.12"
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
name:
type: str

View file

@ -26,6 +26,10 @@ description:
be returned that way by this module. You may pass single values for attributes when calling the module,
and this will be translated into a list suitable for the API.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
auth_keycloak_url:
description:

View file

@ -26,6 +26,9 @@ requirements:
- keyring (Python library)
- gnome-keyring (application - required for headless Linux keyring access)
- dbus-run-session (application - required for headless Linux keyring access)
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
service:
description: The name of the service.

View file

@ -23,6 +23,10 @@ notes:
- |
C(ss) returns all processes for each listen address and port.
This plugin will return each of them, so multiple entries for the same listen address and port are likely in results.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.facts
- community.general.attributes.facts_module
options:
command:
description:

View file

@ -18,6 +18,8 @@ version_added: 5.8.0
short_description: Listing of resource policy_profiles in ManageIQ
extends_documentation_fragment:
- community.general.manageiq
- community.general.attributes
- community.general.attributes.info_module
author: Alexei Znamensky (@russoz)
description:

View file

@ -15,7 +15,9 @@ module: manageiq_tags_info
version_added: 5.8.0
short_description: Retrieve resource tags in ManageIQ
extends_documentation_fragment:
- community.general.manageiq
- community.general.manageiq
- community.general.attributes
- community.general.attributes.info_module
author: Alexei Znamensky (@russoz)
description:

View file

@ -19,6 +19,9 @@ notes:
description:
- Retrieve Memstore product usage information.
- This module was called C(memset_memstore_facts) before Ansible 2.9. The usage did not change.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
api_key:
required: true

View file

@ -19,6 +19,9 @@ notes:
description:
- Retrieve server information.
- This module was called C(memset_server_facts) before Ansible 2.9. The usage did not change.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
api_key:
required: true

View file

@ -16,6 +16,9 @@ short_description: Retrieve information on nginx status.
description:
- Gathers information from nginx from an URL having C(stub_status) enabled.
author: "René Moser (@resmo)"
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
url:
type: str

View file

@ -21,6 +21,8 @@ requirements:
- python-nomad
extends_documentation_fragment:
- community.general.nomad
- community.general.attributes
- community.general.attributes.info_module
options:
name:
description:

View file

@ -17,6 +17,9 @@ description:
- This module was called C(one_image_facts) before Ansible 2.9. The usage did not change.
requirements:
- pyone
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
api_url:
description:

View file

@ -29,6 +29,9 @@ description:
- This module was called C(onepassword_facts) before Ansible 2.9, returning C(ansible_facts).
Note that the M(community.general.onepassword_info) module no longer returns C(ansible_facts)!
You must now use the C(register) option to use the facts in other tasks.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
search_terms:
type: list

View file

@ -34,8 +34,10 @@ options:
elements: str
extends_documentation_fragment:
- community.general.oneview
- community.general.oneview.factsparams
- community.general.oneview
- community.general.oneview.factsparams
- community.general.attributes
- community.general.attributes.info_module
'''

View file

@ -36,8 +36,10 @@ options:
elements: raw
extends_documentation_fragment:
- community.general.oneview
- community.general.oneview.factsparams
- community.general.oneview
- community.general.oneview.factsparams
- community.general.attributes
- community.general.attributes.info_module
'''

View file

@ -33,8 +33,10 @@ options:
type: list
elements: str
extends_documentation_fragment:
- community.general.oneview
- community.general.oneview.factsparams
- community.general.oneview
- community.general.oneview.factsparams
- community.general.attributes
- community.general.attributes.info_module
'''

View file

@ -28,8 +28,10 @@ options:
type: str
extends_documentation_fragment:
- community.general.oneview
- community.general.oneview.factsparams
- community.general.oneview
- community.general.oneview.factsparams
- community.general.attributes
- community.general.attributes.info_module
'''

View file

@ -27,8 +27,10 @@ options:
- FCoE Network name.
type: str
extends_documentation_fragment:
- community.general.oneview
- community.general.oneview.factsparams
- community.general.oneview
- community.general.oneview.factsparams
- community.general.attributes
- community.general.attributes.info_module
'''

View file

@ -28,8 +28,10 @@ options:
- Logical Interconnect Group name.
type: str
extends_documentation_fragment:
- community.general.oneview
- community.general.oneview.factsparams
- community.general.oneview
- community.general.oneview.factsparams
- community.general.attributes
- community.general.attributes.info_module
'''

View file

@ -36,8 +36,10 @@ options:
elements: str
extends_documentation_fragment:
- community.general.oneview
- community.general.oneview.factsparams
- community.general.oneview
- community.general.oneview.factsparams
- community.general.attributes
- community.general.attributes.info_module
'''

View file

@ -36,7 +36,9 @@ options:
- C(sort): The sort order of the returned data set."
type: dict
extends_documentation_fragment:
- community.general.oneview
- community.general.oneview
- community.general.attributes
- community.general.attributes.info_module
'''

View file

@ -18,7 +18,9 @@ description:
author:
- "Remy Leone (@remyleone)"
extends_documentation_fragment:
- community.general.online
- community.general.online
- community.general.attributes
- community.general.attributes.info_module
'''

View file

@ -15,7 +15,9 @@ description:
author:
- "Remy Leone (@remyleone)"
extends_documentation_fragment:
- community.general.online
- community.general.online
- community.general.attributes
- community.general.attributes.info_module
'''
EXAMPLES = r'''

View file

@ -14,6 +14,9 @@ module: pip_package_info
short_description: pip package information
description:
- Return information about installed pip packages
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
clients:
description:
@ -24,7 +27,7 @@ options:
type: list
elements: path
requirements:
- The requested pip executables must be installed on the target.
- The requested pip executables must be installed on the target.
author:
- Matthew Jones (@matburt)
- Brian Coca (@bcoca)

View file

@ -16,6 +16,9 @@ short_description: Rretrieves information about applications installed with pipx
version_added: 5.6.0
description:
- Retrieve details about Python applications installed in isolated virtualenvs using pipx.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
name:
description:

View file

@ -18,6 +18,8 @@ description:
- A module to list Pritunl organizations using the Pritunl API.
extends_documentation_fragment:
- community.general.pritunl
- community.general.attributes
- community.general.attributes.info_module
options:
organization:
type: str

View file

@ -18,6 +18,8 @@ description:
- A module to list Pritunl users using the Pritunl API.
extends_documentation_fragment:
- community.general.pritunl
- community.general.attributes
- community.general.attributes.info_module
options:
organization:
type: str

View file

@ -23,7 +23,10 @@ options:
aliases: ['realm', 'name']
type: str
author: Tristan Le Guern (@tleguern)
extends_documentation_fragment: community.general.proxmox.documentation
extends_documentation_fragment:
- community.general.proxmox.documentation
- community.general.attributes
- community.general.attributes.info_module
'''

View file

@ -23,7 +23,10 @@ options:
aliases: ['groupid', 'name']
type: str
author: Tristan Le Guern (@tleguern)
extends_documentation_fragment: community.general.proxmox.documentation
extends_documentation_fragment:
- community.general.proxmox.documentation
- community.general.attributes
- community.general.attributes.info_module
'''

View file

@ -27,7 +27,10 @@ options:
- Filter on a specifc storage type.
type: str
author: Tristan Le Guern (@tleguern)
extends_documentation_fragment: community.general.proxmox.documentation
extends_documentation_fragment:
- community.general.proxmox.documentation
- community.general.attributes
- community.general.attributes.info_module
notes:
- Storage specific options can be returned by this module, please look at the documentation at U(https://pve.proxmox.com/wiki/Storage).
'''

View file

@ -30,6 +30,8 @@ options:
type: str
extends_documentation_fragment:
- community.general.proxmox.documentation
- community.general.attributes
- community.general.attributes.info_module
'''

View file

@ -32,7 +32,10 @@ options:
- Restrict results to a specific user ID, which is a concatenation of a user and domain parts.
type: str
author: Tristan Le Guern (@tleguern)
extends_documentation_fragment: community.general.proxmox.documentation
extends_documentation_fragment:
- community.general.proxmox.documentation
- community.general.attributes
- community.general.attributes.info_module
'''
EXAMPLES = '''

View file

@ -13,6 +13,9 @@ 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.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
dependencies:
type: list

View file

@ -13,7 +13,7 @@ DOCUMENTATION = '''
module: rax_facts
short_description: Gather facts for Rackspace Cloud Servers
description:
- Gather facts for Rackspace Cloud Servers.
- Gather facts for Rackspace Cloud Servers.
options:
address:
type: str
@ -30,7 +30,10 @@ options:
- Server name to retrieve facts for
author: "Matt Martz (@sivel)"
extends_documentation_fragment:
- community.general.rackspace.openstack
- community.general.rackspace.openstack
- community.general.attributes
- community.general.attributes.facts
- community.general.attributes.facts_module
'''

View file

@ -18,6 +18,9 @@ description:
- Information retrieved is placed in a location specified by the user.
- This module was called C(redfish_facts) before Ansible 2.9, returning C(ansible_facts).
Note that the M(community.general.redfish_info) module no longer returns C(ansible_facts)!
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
category:
required: false

View file

@ -25,6 +25,8 @@ options:
extends_documentation_fragment:
- community.general.redis
- community.general.attributes
- community.general.attributes.info_module
seealso:
- module: community.general.redis_data

View file

@ -16,6 +16,9 @@ short_description: Gather information about Redis servers
version_added: '0.2.0'
description:
- Gathers information and statistics about Redis servers.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
login_host:
description:

View file

@ -41,6 +41,8 @@ options:
extends_documentation_fragment:
- community.general.rundeck
- url
- community.general.attributes
- community.general.attributes.info_module
'''
EXAMPLES = '''

View file

@ -21,7 +21,8 @@ description:
- This module return information about a container namespace on Scaleway account.
extends_documentation_fragment:
- community.general.scaleway
- community.general.attributes
- community.general.attributes.info_module
options:
project_id:

View file

@ -21,7 +21,8 @@ description:
- This module return information about a container registry on Scaleway account.
extends_documentation_fragment:
- community.general.scaleway
- community.general.attributes
- community.general.attributes.info_module
options:
project_id:

View file

@ -21,7 +21,8 @@ description:
- This module return information about a function on Scaleway account.
extends_documentation_fragment:
- community.general.scaleway
- community.general.attributes
- community.general.attributes.info_module
options:
namespace_id:

View file

@ -21,7 +21,8 @@ description:
- This module return information about a function namespace on Scaleway account.
extends_documentation_fragment:
- community.general.scaleway
- community.general.attributes
- community.general.attributes.info_module
options:
project_id:

View file

@ -18,7 +18,9 @@ author:
- "Yanis Guenane (@Spredzy)"
- "Remy Leone (@remyleone)"
extends_documentation_fragment:
- community.general.scaleway
- community.general.scaleway
- community.general.attributes
- community.general.attributes.info_module
options:
region:

View file

@ -18,7 +18,9 @@ author:
- "Yanis Guenane (@Spredzy)"
- "Remy Leone (@remyleone)"
extends_documentation_fragment:
- community.general.scaleway
- community.general.scaleway
- community.general.attributes
- community.general.attributes.info_module
options:
region:

View file

@ -24,7 +24,9 @@ options:
default: 'https://account.scaleway.com'
aliases: ['base_url']
extends_documentation_fragment:
- community.general.scaleway
- community.general.scaleway
- community.general.attributes
- community.general.attributes.info_module
'''

View file

@ -33,7 +33,9 @@ options:
- waw1
- EMEA-PL-WAW1
extends_documentation_fragment:
- community.general.scaleway
- community.general.scaleway
- community.general.attributes
- community.general.attributes.info_module
'''

View file

@ -18,7 +18,9 @@ author:
- "Yanis Guenane (@Spredzy)"
- "Remy Leone (@remyleone)"
extends_documentation_fragment:
- community.general.scaleway
- community.general.scaleway
- community.general.attributes
- community.general.attributes.info_module
options:
region:

View file

@ -18,7 +18,9 @@ author:
- "Yanis Guenane (@Spredzy)"
- "Remy Leone (@remyleone)"
extends_documentation_fragment:
- community.general.scaleway
- community.general.scaleway
- community.general.attributes
- community.general.attributes.info_module
options:
region:

View file

@ -18,7 +18,9 @@ author:
- "Yanis Guenane (@Spredzy)"
- "Remy Leone (@remyleone)"
extends_documentation_fragment:
- community.general.scaleway
- community.general.scaleway
- community.general.attributes
- community.general.attributes.info_module
options:
region:

View file

@ -18,6 +18,9 @@ description:
- This module was called C(smartos_image_facts) before Ansible 2.9, returning C(ansible_facts).
Note that the M(community.general.smartos_image_info) module no longer returns C(ansible_facts)!
author: Adam Števko (@xen0l)
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
filters:
description:

View file

@ -20,6 +20,10 @@ description:
inserted to the ansible_facts key.
requirements:
- pysnmp
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.facts
- community.general.attributes.facts_module
options:
host:
description:

View file

@ -31,7 +31,9 @@ options:
required: true
extends_documentation_fragment:
- community.general.utm
- community.general.utm
- community.general.attributes
- community.general.attributes.info_module
'''

View file

@ -30,8 +30,9 @@ options:
required: true
extends_documentation_fragment:
- community.general.utm
- community.general.utm
- community.general.attributes
- community.general.attributes.info_module
'''
EXAMPLES = """

View file

@ -29,8 +29,9 @@ options:
required: true
extends_documentation_fragment:
- community.general.utm
- community.general.utm
- community.general.attributes
- community.general.attributes.info_module
'''
EXAMPLES = """

View file

@ -31,8 +31,9 @@ options:
required: true
extends_documentation_fragment:
- community.general.utm
- community.general.utm
- community.general.attributes
- community.general.attributes.info_module
'''
EXAMPLES = """

View file

@ -31,8 +31,9 @@ options:
required: true
extends_documentation_fragment:
- community.general.utm
- community.general.utm
- community.general.attributes
- community.general.attributes.info_module
'''
EXAMPLES = """

View file

@ -17,6 +17,9 @@ description:
- Gathers Vertica database information.
- This module was called C(vertica_facts) before Ansible 2.9, returning C(ansible_facts).
Note that the M(community.general.vertica_info) module no longer returns C(ansible_facts)!
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
cluster:
description:

View file

@ -16,6 +16,9 @@ version_added: 5.4.0
description:
- Builds Redfish URIs locally and sends them to remote OOB controllers to
get information back.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
category:
required: true

View file

@ -16,9 +16,13 @@ short_description: get facts reported on xenserver
description:
- Reads data out of XenAPI, can be used instead of multiple xe commands.
author:
- Andy Hill (@andyhky)
- Tim Rupp (@caphrim007)
- Robin Lee (@cheese)
- Andy Hill (@andyhky)
- Tim Rupp (@caphrim007)
- Robin Lee (@cheese)
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.facts
- community.general.attributes.facts_module
options: {}
'''

View file

@ -47,7 +47,8 @@ options:
type: str
extends_documentation_fragment:
- community.general.xenserver.documentation
- community.general.attributes
- community.general.attributes.info_module
'''
EXAMPLES = r'''

View file

@ -15,6 +15,9 @@ short_description: Retrieve XFCE4 configurations
version_added: 3.5.0
description:
- This module allows retrieving Xfce 4 configurations with the help of C(xfconf-query).
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.info_module
options:
channel:
description:

View file

@ -16,6 +16,10 @@ short_description: Gather facts about ZFS datasets.
description:
- Gather facts from ZFS dataset properties.
author: Adam Števko (@xen0l)
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.facts
- community.general.attributes.facts_module
options:
name:
description:

View file

@ -16,6 +16,10 @@ short_description: Gather facts about ZFS pools.
description:
- Gather facts from ZFS pool properties.
author: Adam Števko (@xen0l)
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes.facts
- community.general.attributes.facts_module
options:
name:
description: