From aff78f4cbc9a1afe70ca447e17e4c99582ad16b3 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 6 Oct 2020 18:37:16 +0200 Subject: [PATCH] Fix various sanity errors in plugins (#71736) * Fix various sanity errors in plugins. * Revert callback_type -> type transform. * Undo paramiko_ssh 'connection' change, since this discrepancy is hardcoded in the plugin loader. * Standardize on name and type (for callbacks). * Fix existing author entries. * Add 'Unknown (!UNKNOWN)' as author when author is missing. * These are actually parsed as integers in the code. * Revert "Add 'Unknown (!UNKNOWN)' as author when author is missing." This reverts commit 29d1438aca4cb1988ac81c9f6cb3c4e0403b5fae. --- lib/ansible/plugins/become/runas.py | 2 +- lib/ansible/plugins/become/su.py | 2 +- lib/ansible/plugins/become/sudo.py | 2 +- lib/ansible/plugins/cache/jsonfile.py | 2 +- lib/ansible/plugins/cache/memory.py | 2 +- lib/ansible/plugins/callback/default.py | 2 +- lib/ansible/plugins/callback/junit.py | 2 +- lib/ansible/plugins/callback/minimal.py | 2 +- lib/ansible/plugins/callback/oneline.py | 2 +- lib/ansible/plugins/callback/tree.py | 4 ++-- lib/ansible/plugins/connection/local.py | 2 +- .../plugins/connection/paramiko_ssh.py | 2 +- lib/ansible/plugins/connection/psrp.py | 2 +- lib/ansible/plugins/connection/ssh.py | 2 +- lib/ansible/plugins/connection/winrm.py | 2 +- .../plugins/inventory/advanced_host_list.py | 2 +- lib/ansible/plugins/inventory/auto.py | 4 ++-- lib/ansible/plugins/inventory/constructed.py | 1 - lib/ansible/plugins/inventory/generator.py | 1 - lib/ansible/plugins/inventory/host_list.py | 2 +- lib/ansible/plugins/inventory/ini.py | 2 +- lib/ansible/plugins/inventory/script.py | 2 +- lib/ansible/plugins/inventory/toml.py | 4 ++-- lib/ansible/plugins/inventory/yaml.py | 2 +- lib/ansible/plugins/lookup/config.py | 5 +++-- lib/ansible/plugins/lookup/csvfile.py | 4 +++- lib/ansible/plugins/lookup/dict.py | 2 +- lib/ansible/plugins/lookup/env.py | 2 +- lib/ansible/plugins/lookup/file.py | 6 +++-- lib/ansible/plugins/lookup/fileglob.py | 6 +++-- lib/ansible/plugins/lookup/first_found.py | 6 +++-- lib/ansible/plugins/lookup/indexed_items.py | 5 +++-- lib/ansible/plugins/lookup/ini.py | 6 +++-- .../plugins/lookup/inventory_hostnames.py | 6 ++--- lib/ansible/plugins/lookup/items.py | 4 ++-- lib/ansible/plugins/lookup/lines.py | 6 +++-- lib/ansible/plugins/lookup/list.py | 6 +++-- lib/ansible/plugins/lookup/nested.py | 2 +- lib/ansible/plugins/lookup/password.py | 10 +++++---- lib/ansible/plugins/lookup/pipe.py | 6 +++-- lib/ansible/plugins/lookup/random_choice.py | 5 +++-- lib/ansible/plugins/lookup/sequence.py | 13 ++++++----- lib/ansible/plugins/lookup/subelements.py | 4 ++-- lib/ansible/plugins/lookup/template.py | 6 +++-- lib/ansible/plugins/lookup/together.py | 6 +++-- lib/ansible/plugins/lookup/unvault.py | 6 +++-- lib/ansible/plugins/lookup/url.py | 22 ++++++++++--------- lib/ansible/plugins/lookup/varnames.py | 4 ++-- lib/ansible/plugins/lookup/vars.py | 6 +++-- lib/ansible/plugins/shell/cmd.py | 1 - lib/ansible/plugins/shell/powershell.py | 1 - lib/ansible/plugins/shell/sh.py | 1 - lib/ansible/plugins/strategy/debug.py | 4 ++-- lib/ansible/plugins/strategy/free.py | 2 +- lib/ansible/plugins/strategy/host_pinned.py | 2 +- lib/ansible/plugins/strategy/linear.py | 2 +- lib/ansible/plugins/vars/host_group_vars.py | 2 +- 57 files changed, 124 insertions(+), 97 deletions(-) diff --git a/lib/ansible/plugins/become/runas.py b/lib/ansible/plugins/become/runas.py index c8ae881c3c2..1d6e8f9f947 100644 --- a/lib/ansible/plugins/become/runas.py +++ b/lib/ansible/plugins/become/runas.py @@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - become: runas + name: runas short_description: Run As user description: - This become plugins allows your remote/login user to execute commands as another user via the windows runas facility. diff --git a/lib/ansible/plugins/become/su.py b/lib/ansible/plugins/become/su.py index e200165567e..3d6a07b5b00 100644 --- a/lib/ansible/plugins/become/su.py +++ b/lib/ansible/plugins/become/su.py @@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - become: su + name: su short_description: Substitute User description: - This become plugins allows your remote/login user to execute commands as another user via the su utility. diff --git a/lib/ansible/plugins/become/sudo.py b/lib/ansible/plugins/become/sudo.py index a7593cce95f..a4093b85f0b 100644 --- a/lib/ansible/plugins/become/sudo.py +++ b/lib/ansible/plugins/become/sudo.py @@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - become: sudo + name: sudo short_description: Substitute User DO description: - This become plugins allows your remote/login user to execute commands as another user via the sudo utility. diff --git a/lib/ansible/plugins/cache/jsonfile.py b/lib/ansible/plugins/cache/jsonfile.py index 7605dc41112..7ee037292ea 100644 --- a/lib/ansible/plugins/cache/jsonfile.py +++ b/lib/ansible/plugins/cache/jsonfile.py @@ -7,7 +7,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - cache: jsonfile + name: jsonfile short_description: JSON formatted files. description: - This cache uses JSON formatted, per host, files saved to the filesystem. diff --git a/lib/ansible/plugins/cache/memory.py b/lib/ansible/plugins/cache/memory.py index 1bccd544b2d..59f97b6eeda 100644 --- a/lib/ansible/plugins/cache/memory.py +++ b/lib/ansible/plugins/cache/memory.py @@ -7,7 +7,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - cache: memory + name: memory short_description: RAM backed, non persistent description: - RAM backed cache that is not persistent. diff --git a/lib/ansible/plugins/callback/default.py b/lib/ansible/plugins/callback/default.py index ebea3812bd2..7872974d4f3 100644 --- a/lib/ansible/plugins/callback/default.py +++ b/lib/ansible/plugins/callback/default.py @@ -6,7 +6,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - callback: default + name: default type: stdout short_description: default Ansible screen output version_added: historical diff --git a/lib/ansible/plugins/callback/junit.py b/lib/ansible/plugins/callback/junit.py index 2fc892924d9..0b55ce72677 100644 --- a/lib/ansible/plugins/callback/junit.py +++ b/lib/ansible/plugins/callback/junit.py @@ -6,7 +6,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - callback: junit + name: junit type: aggregate short_description: write playbook output to a JUnit file. version_added: historical diff --git a/lib/ansible/plugins/callback/minimal.py b/lib/ansible/plugins/callback/minimal.py index 8d3aef5b725..6fcb07d0484 100644 --- a/lib/ansible/plugins/callback/minimal.py +++ b/lib/ansible/plugins/callback/minimal.py @@ -7,7 +7,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - callback: minimal + name: minimal type: stdout short_description: minimal Ansible screen output version_added: historical diff --git a/lib/ansible/plugins/callback/oneline.py b/lib/ansible/plugins/callback/oneline.py index 20b5be7f71c..fd51b27eeb8 100644 --- a/lib/ansible/plugins/callback/oneline.py +++ b/lib/ansible/plugins/callback/oneline.py @@ -7,7 +7,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - callback: oneline + name: oneline type: stdout short_description: oneline Ansible screen output version_added: historical diff --git a/lib/ansible/plugins/callback/tree.py b/lib/ansible/plugins/callback/tree.py index 209afafc648..23892f39a6b 100644 --- a/lib/ansible/plugins/callback/tree.py +++ b/lib/ansible/plugins/callback/tree.py @@ -6,8 +6,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - callback: tree - callback_type: notification + name: tree + type: notification requirements: - invoked in the command line short_description: Save host events to files diff --git a/lib/ansible/plugins/connection/local.py b/lib/ansible/plugins/connection/local.py index 297e3d32041..b328f48ac8c 100644 --- a/lib/ansible/plugins/connection/local.py +++ b/lib/ansible/plugins/connection/local.py @@ -6,7 +6,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - connection: local + name: local short_description: execute on controller description: - This connection plugin allows ansible to execute tasks on the Ansible 'controller' instead of on a remote host. diff --git a/lib/ansible/plugins/connection/paramiko_ssh.py b/lib/ansible/plugins/connection/paramiko_ssh.py index 96a76d67461..7a3369b9250 100644 --- a/lib/ansible/plugins/connection/paramiko_ssh.py +++ b/lib/ansible/plugins/connection/paramiko_ssh.py @@ -6,7 +6,7 @@ __metaclass__ = type DOCUMENTATION = """ author: Ansible Core Team - connection: paramiko + name: paramiko short_description: Run tasks via python ssh (paramiko) description: - Use the python ssh implementation (Paramiko) to connect to targets diff --git a/lib/ansible/plugins/connection/psrp.py b/lib/ansible/plugins/connection/psrp.py index 1892a4d7d9c..403a70a5ae7 100644 --- a/lib/ansible/plugins/connection/psrp.py +++ b/lib/ansible/plugins/connection/psrp.py @@ -6,7 +6,7 @@ __metaclass__ = type DOCUMENTATION = """ author: Ansible Core Team -connection: psrp +name: psrp short_description: Run tasks over Microsoft PowerShell Remoting Protocol description: - Run commands or put/fetch on a target via PSRP (WinRM plugin) diff --git a/lib/ansible/plugins/connection/ssh.py b/lib/ansible/plugins/connection/ssh.py index ed44a035fe0..fd1a06bfefd 100644 --- a/lib/ansible/plugins/connection/ssh.py +++ b/lib/ansible/plugins/connection/ssh.py @@ -8,7 +8,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - connection: ssh + name: ssh short_description: connect via ssh client binary description: - This connection plugin allows ansible to communicate to the target machines via normal ssh command line. diff --git a/lib/ansible/plugins/connection/winrm.py b/lib/ansible/plugins/connection/winrm.py index d7ead524f66..a3a7b681af6 100644 --- a/lib/ansible/plugins/connection/winrm.py +++ b/lib/ansible/plugins/connection/winrm.py @@ -7,7 +7,7 @@ __metaclass__ = type DOCUMENTATION = """ author: Ansible Core Team - connection: winrm + name: winrm short_description: Run tasks over Microsoft's WinRM description: - Run commands or put/fetch on a target via WinRM diff --git a/lib/ansible/plugins/inventory/advanced_host_list.py b/lib/ansible/plugins/inventory/advanced_host_list.py index dae0242780a..c61a4656cb4 100644 --- a/lib/ansible/plugins/inventory/advanced_host_list.py +++ b/lib/ansible/plugins/inventory/advanced_host_list.py @@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - inventory: advanced_host_list + name: advanced_host_list version_added: "2.4" short_description: Parses a 'host list' with ranges description: diff --git a/lib/ansible/plugins/inventory/auto.py b/lib/ansible/plugins/inventory/auto.py index cf4ed0c347c..82d96650ed6 100644 --- a/lib/ansible/plugins/inventory/auto.py +++ b/lib/ansible/plugins/inventory/auto.py @@ -6,9 +6,9 @@ __metaclass__ = type DOCUMENTATION = ''' name: auto - plugin_type: inventory author: - - Matt Davis <@nitzmahone> + - Matt Davis (@nitzmahone) + version_added: "2.5" short_description: Loads and executes an inventory plugin specified in a YAML config description: - By whitelisting C(auto) inventory plugin, any YAML inventory config file with a diff --git a/lib/ansible/plugins/inventory/constructed.py b/lib/ansible/plugins/inventory/constructed.py index 1e9c375b34b..424eb00e977 100644 --- a/lib/ansible/plugins/inventory/constructed.py +++ b/lib/ansible/plugins/inventory/constructed.py @@ -6,7 +6,6 @@ __metaclass__ = type DOCUMENTATION = ''' name: constructed - plugin_type: inventory version_added: "2.4" short_description: Uses Jinja2 to construct vars and groups based on existing inventory. description: diff --git a/lib/ansible/plugins/inventory/generator.py b/lib/ansible/plugins/inventory/generator.py index 4a7d3b7acb1..27575dd0c71 100644 --- a/lib/ansible/plugins/inventory/generator.py +++ b/lib/ansible/plugins/inventory/generator.py @@ -6,7 +6,6 @@ __metaclass__ = type DOCUMENTATION = ''' name: generator - plugin_type: inventory version_added: "2.6" short_description: Uses Jinja2 to construct hosts and groups from patterns description: diff --git a/lib/ansible/plugins/inventory/host_list.py b/lib/ansible/plugins/inventory/host_list.py index 4a7a98d8ce3..eee851653ec 100644 --- a/lib/ansible/plugins/inventory/host_list.py +++ b/lib/ansible/plugins/inventory/host_list.py @@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = r''' - inventory: host_list + name: host_list version_added: "2.4" short_description: Parses a 'host list' string description: diff --git a/lib/ansible/plugins/inventory/ini.py b/lib/ansible/plugins/inventory/ini.py index 366171ea435..be9ec2fce96 100644 --- a/lib/ansible/plugins/inventory/ini.py +++ b/lib/ansible/plugins/inventory/ini.py @@ -4,7 +4,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - inventory: ini + name: ini version_added: "2.4" short_description: Uses an Ansible INI file as inventory source. description: diff --git a/lib/ansible/plugins/inventory/script.py b/lib/ansible/plugins/inventory/script.py index b4094a569f2..d94f35d8fc6 100644 --- a/lib/ansible/plugins/inventory/script.py +++ b/lib/ansible/plugins/inventory/script.py @@ -6,7 +6,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - inventory: script + name: script version_added: "2.4" short_description: Executes an inventory script that returns JSON options: diff --git a/lib/ansible/plugins/inventory/toml.py b/lib/ansible/plugins/inventory/toml.py index b4c8de1ce67..50e1ced5568 100644 --- a/lib/ansible/plugins/inventory/toml.py +++ b/lib/ansible/plugins/inventory/toml.py @@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = r''' - inventory: toml + name: toml version_added: "2.8" short_description: Uses a specific TOML file as an inventory source. description: @@ -153,7 +153,7 @@ class InventoryModule(BaseFileInventoryPlugin): NAME = 'toml' def _parse_group(self, group, group_data): - if not isinstance(group_data, (MutableMapping, type(None))): + if group_data is not None and not isinstance(group_data, MutableMapping): self.display.warning("Skipping '%s' as this is not a valid group definition" % group) return diff --git a/lib/ansible/plugins/inventory/yaml.py b/lib/ansible/plugins/inventory/yaml.py index dc882c6d357..f927e00b791 100644 --- a/lib/ansible/plugins/inventory/yaml.py +++ b/lib/ansible/plugins/inventory/yaml.py @@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - inventory: yaml + name: yaml version_added: "2.4" short_description: Uses a specific YAML file as an inventory source. description: diff --git a/lib/ansible/plugins/lookup/config.py b/lib/ansible/plugins/lookup/config.py index 20ec25427fc..245ea67c733 100644 --- a/lib/ansible/plugins/lookup/config.py +++ b/lib/ansible/plugins/lookup/config.py @@ -4,8 +4,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: config - author: Ansible Core + name: config + author: Ansible Core Team version_added: "2.5" short_description: Lookup current Ansible configuration values description: @@ -53,6 +53,7 @@ RETURN = """ _raw: description: - value(s) of the key(s) in the config + type: raw """ from ansible import constants as C diff --git a/lib/ansible/plugins/lookup/csvfile.py b/lib/ansible/plugins/lookup/csvfile.py index e0ffa69be94..272b4a77679 100644 --- a/lib/ansible/plugins/lookup/csvfile.py +++ b/lib/ansible/plugins/lookup/csvfile.py @@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: csvfile + name: csvfile author: Jan-Piet Mens (@jpmens) version_added: "1.5" short_description: read data from a TSV or CSV file @@ -61,6 +61,8 @@ RETURN = """ _raw: description: - value(s) stored in file column + type: list + elements: str """ import codecs diff --git a/lib/ansible/plugins/lookup/dict.py b/lib/ansible/plugins/lookup/dict.py index 95480a33188..5a83d9e8a13 100644 --- a/lib/ansible/plugins/lookup/dict.py +++ b/lib/ansible/plugins/lookup/dict.py @@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: dict + name: dict version_added: "1.5" short_description: returns key/value pair items from dictionaries description: diff --git a/lib/ansible/plugins/lookup/env.py b/lib/ansible/plugins/lookup/env.py index bb0fae5f485..154e7553da2 100644 --- a/lib/ansible/plugins/lookup/env.py +++ b/lib/ansible/plugins/lookup/env.py @@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: env + name: env author: Jan-Piet Mens (@jpmens) version_added: "0.9" short_description: Read the value of environment variables diff --git a/lib/ansible/plugins/lookup/file.py b/lib/ansible/plugins/lookup/file.py index 3ce41559bd6..04ddc4b1ea9 100644 --- a/lib/ansible/plugins/lookup/file.py +++ b/lib/ansible/plugins/lookup/file.py @@ -5,8 +5,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: file - author: Daniel Hokka Zakrisson + name: file + author: Daniel Hokka Zakrisson (!UNKNOWN) version_added: "0.9" short_description: read file contents description: @@ -45,6 +45,8 @@ RETURN = """ _raw: description: - content of file(s) + type: list + elements: str """ from ansible.errors import AnsibleError, AnsibleParserError diff --git a/lib/ansible/plugins/lookup/fileglob.py b/lib/ansible/plugins/lookup/fileglob.py index 05628defd8e..84ae6312ff5 100644 --- a/lib/ansible/plugins/lookup/fileglob.py +++ b/lib/ansible/plugins/lookup/fileglob.py @@ -5,8 +5,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: fileglob - author: Michael DeHaan + name: fileglob + author: Michael DeHaan version_added: "1.4" short_description: list files matching a pattern description: @@ -41,6 +41,8 @@ RETURN = """ _list: description: - list of files + type: list + elements: path """ import os diff --git a/lib/ansible/plugins/lookup/first_found.py b/lib/ansible/plugins/lookup/first_found.py index 1668f51f2b7..ffe9fd30f65 100644 --- a/lib/ansible/plugins/lookup/first_found.py +++ b/lib/ansible/plugins/lookup/first_found.py @@ -5,8 +5,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: first_found - author: Seth Vidal + name: first_found + author: Seth Vidal (!UNKNOWN) version_added: historical short_description: return first file found from list description: @@ -99,6 +99,8 @@ RETURN = """ _raw: description: - path to file found + type: list + elements: path """ import os diff --git a/lib/ansible/plugins/lookup/indexed_items.py b/lib/ansible/plugins/lookup/indexed_items.py index cd25ba15fa6..7f77b6f84bd 100644 --- a/lib/ansible/plugins/lookup/indexed_items.py +++ b/lib/ansible/plugins/lookup/indexed_items.py @@ -5,8 +5,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: indexed_items - author: Michael DeHaan + name: indexed_items + author: Michael DeHaan version_added: "1.3" short_description: rewrites lists to return 'indexed items' description: @@ -31,6 +31,7 @@ RETURN = """ description: - list with each item.0 giving you the position and item.1 the value type: list + elements: list """ from ansible.errors import AnsibleError diff --git a/lib/ansible/plugins/lookup/ini.py b/lib/ansible/plugins/lookup/ini.py index f886a8d9b1b..a2e16070326 100644 --- a/lib/ansible/plugins/lookup/ini.py +++ b/lib/ansible/plugins/lookup/ini.py @@ -5,8 +5,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: ini - author: Yannig Perre + name: ini + author: Yannig Perre (!UNKNOWN) version_added: "2.0" short_description: read data from a ini file description: @@ -56,6 +56,8 @@ RETURN = """ _raw: description: - value(s) of the key(s) in the ini file + type: list + elements: str """ import os import re diff --git a/lib/ansible/plugins/lookup/inventory_hostnames.py b/lib/ansible/plugins/lookup/inventory_hostnames.py index 0d10dc5a439..a3cff92ea96 100644 --- a/lib/ansible/plugins/lookup/inventory_hostnames.py +++ b/lib/ansible/plugins/lookup/inventory_hostnames.py @@ -7,10 +7,10 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: inventory_hostnames + name: inventory_hostnames author: - - Michael DeHaan - - Steven Dossett + - Michael DeHaan + - Steven Dossett (!UNKNOWN) version_added: "1.3" short_description: list of inventory hosts matching a host pattern description: diff --git a/lib/ansible/plugins/lookup/items.py b/lib/ansible/plugins/lookup/items.py index 6a4299e70b7..9cb270300f6 100644 --- a/lib/ansible/plugins/lookup/items.py +++ b/lib/ansible/plugins/lookup/items.py @@ -5,8 +5,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: items - author: Michael DeHaan + name: items + author: Michael DeHaan version_added: historical short_description: list of items description: diff --git a/lib/ansible/plugins/lookup/lines.py b/lib/ansible/plugins/lookup/lines.py index 2707d6cbf3b..fa578e62c1b 100644 --- a/lib/ansible/plugins/lookup/lines.py +++ b/lib/ansible/plugins/lookup/lines.py @@ -6,8 +6,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: lines - author: Daniel Hokka Zakrisson + name: lines + author: Daniel Hokka Zakrisson (!UNKNOWN) version_added: "0.9" short_description: read lines from command description: @@ -37,6 +37,8 @@ RETURN = """ _list: description: - lines of stdout from command + type: list + elements: str """ import subprocess diff --git a/lib/ansible/plugins/lookup/list.py b/lib/ansible/plugins/lookup/list.py index 60ea53151ac..8d6d900a422 100644 --- a/lib/ansible/plugins/lookup/list.py +++ b/lib/ansible/plugins/lookup/list.py @@ -7,8 +7,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: list - author: Ansible core team + name: list + author: Ansible Core Team version_added: "2.0" short_description: simply returns what it is given. description: @@ -27,6 +27,8 @@ EXAMPLES = """ RETURN = """ _list: description: basically the same as you fed in + type: list + elements: raw """ from ansible.module_utils.common._collections_compat import Sequence diff --git a/lib/ansible/plugins/lookup/nested.py b/lib/ansible/plugins/lookup/nested.py index 45304b7be5a..e38a0f5cec2 100644 --- a/lib/ansible/plugins/lookup/nested.py +++ b/lib/ansible/plugins/lookup/nested.py @@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: nested + name: nested version_added: "1.1" short_description: composes a list with nested elements of other lists description: diff --git a/lib/ansible/plugins/lookup/password.py b/lib/ansible/plugins/lookup/password.py index f69c610991c..f9ed15ec917 100644 --- a/lib/ansible/plugins/lookup/password.py +++ b/lib/ansible/plugins/lookup/password.py @@ -7,12 +7,12 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: password + name: password version_added: "1.1" author: - - Daniel Hokka Zakrisson - - Javier Candeira - - Maykel Moya + - Daniel Hokka Zakrisson (!UNKNOWN) + - Javier Candeira (!UNKNOWN) + - Maykel Moya (!UNKNOWN) short_description: retrieve or generate a random password, stored in a file description: - Generates a random plaintext password and stores it in a file at a given filepath. @@ -95,6 +95,8 @@ RETURN = """ _raw: description: - a password + type: list + elements: str """ import os diff --git a/lib/ansible/plugins/lookup/pipe.py b/lib/ansible/plugins/lookup/pipe.py index 94ad0104343..d6bce2cd5af 100644 --- a/lib/ansible/plugins/lookup/pipe.py +++ b/lib/ansible/plugins/lookup/pipe.py @@ -5,8 +5,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = r""" - lookup: pipe - author: Daniel Hokka Zakrisson + name: pipe + author: Daniel Hokka Zakrisson (!UNKNOWN) version_added: "0.9" short_description: read output from a command description: @@ -40,6 +40,8 @@ RETURN = r""" _string: description: - stdout from command + type: list + elements: str """ import subprocess diff --git a/lib/ansible/plugins/lookup/random_choice.py b/lib/ansible/plugins/lookup/random_choice.py index 05b4080d489..24aea9ac256 100644 --- a/lib/ansible/plugins/lookup/random_choice.py +++ b/lib/ansible/plugins/lookup/random_choice.py @@ -5,8 +5,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: random_choice - author: Michael DeHaan + name: random_choice + author: Michael DeHaan version_added: "1.1" short_description: return random element from list description: @@ -30,6 +30,7 @@ RETURN = """ _raw: description: - random item + type: raw """ import random diff --git a/lib/ansible/plugins/lookup/sequence.py b/lib/ansible/plugins/lookup/sequence.py index 12625c0505a..e58dd7b10e8 100644 --- a/lib/ansible/plugins/lookup/sequence.py +++ b/lib/ansible/plugins/lookup/sequence.py @@ -5,8 +5,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: sequence - author: Jayson Vantuyl + name: sequence + author: Jayson Vantuyl (!UNKNOWN) version_added: "1.0" short_description: generate a list based on a number sequence description: @@ -21,18 +21,18 @@ DOCUMENTATION = """ start: description: number at which to start the sequence default: 0 - type: number + type: integer end: description: number at which to end the sequence, dont use this with count - type: number + type: integer default: 0 count: description: number of elements in the sequence, this is not to be used with end - type: number + type: integer default: 0 stride: description: increments between sequence numbers, the default is 1 unless the end is less than the start, then it is -1. - type: number + type: integer format: description: return a string with the generated number formatted in """ @@ -74,6 +74,7 @@ RETURN = """ description: - A list containing generated sequence of items type: list + elements: str """ from re import compile as re_compile, IGNORECASE diff --git a/lib/ansible/plugins/lookup/subelements.py b/lib/ansible/plugins/lookup/subelements.py index a948f0204ef..27350b08e94 100644 --- a/lib/ansible/plugins/lookup/subelements.py +++ b/lib/ansible/plugins/lookup/subelements.py @@ -5,8 +5,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: subelements - author: Serge van Ginderachter + name: subelements + author: Serge van Ginderachter (!UNKNOWN) version_added: "1.4" short_description: traverse nested key from a list of dictionaries description: diff --git a/lib/ansible/plugins/lookup/template.py b/lib/ansible/plugins/lookup/template.py index c04b5e0d6a0..8239f8398a2 100644 --- a/lib/ansible/plugins/lookup/template.py +++ b/lib/ansible/plugins/lookup/template.py @@ -6,8 +6,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: template - author: Michael DeHaan + name: template + author: Michael DeHaan version_added: "0.9" short_description: retrieve contents of file after templating with Jinja2 description: @@ -55,6 +55,8 @@ EXAMPLES = """ RETURN = """ _raw: description: file(s) content after templating + type: list + elements: raw """ from copy import deepcopy diff --git a/lib/ansible/plugins/lookup/together.py b/lib/ansible/plugins/lookup/together.py index 1234ac6204f..8ba62f148cd 100644 --- a/lib/ansible/plugins/lookup/together.py +++ b/lib/ansible/plugins/lookup/together.py @@ -5,8 +5,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: together - author: Bradley Young + name: together + author: Bradley Young (!UNKNOWN) version_added: '1.3' short_description: merges lists into synchronized list description: @@ -32,6 +32,8 @@ EXAMPLES = """ RETURN = """ _list: description: synchronized list + type: list + elements: list """ from ansible.errors import AnsibleError from ansible.module_utils.six.moves import zip_longest diff --git a/lib/ansible/plugins/lookup/unvault.py b/lib/ansible/plugins/lookup/unvault.py index 820da6c2d80..152dc95ee3f 100644 --- a/lib/ansible/plugins/lookup/unvault.py +++ b/lib/ansible/plugins/lookup/unvault.py @@ -4,8 +4,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: unvault - author: ansible core team + name: unvault + author: Ansible Core Team version_added: "2.10" short_description: read vaulted file(s) contents description: @@ -26,6 +26,8 @@ RETURN = """ _raw: description: - content of file(s) as bytes + type: list + elements: raw """ from ansible.errors import AnsibleParserError diff --git a/lib/ansible/plugins/lookup/url.py b/lib/ansible/plugins/lookup/url.py index 3896c8b57cb..7990d31ab35 100644 --- a/lib/ansible/plugins/lookup/url.py +++ b/lib/ansible/plugins/lookup/url.py @@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ -lookup: url +name: url author: Brian Coca (@bcoca) version_added: "1.9" short_description: return contents from URL @@ -50,7 +50,7 @@ options: - name: ANSIBLE_LOOKUP_URL_FORCE ini: - section: url_lookup - - key: force + key: force timeout: description: How long to wait for the server to send data before giving up type: float @@ -62,7 +62,7 @@ options: - name: ANSIBLE_LOOKUP_URL_TIMEOUT ini: - section: url_lookup - - key: timeout + key: timeout http_agent: description: User-Agent to use in the request type: string @@ -73,7 +73,7 @@ options: - name: ANSIBLE_LOOKUP_URL_AGENT ini: - section: url_lookup - - key: agent + key: agent force_basic_auth: description: Force basic authentication type: boolean @@ -85,7 +85,7 @@ options: - name: ANSIBLE_LOOKUP_URL_AGENT ini: - section: url_lookup - - key: agent + key: agent follow_redirects: description: String of urllib2, all/yes, safe, none to determine how redirects are followed, see RedirectHandlerFactory for more information type: string @@ -97,7 +97,7 @@ options: - name: ANSIBLE_LOOKUP_URL_FOLLOW_REDIRECTS ini: - section: url_lookup - - key: follow_redirects + key: follow_redirects use_gssapi: description: Use GSSAPI handler of requests type: boolean @@ -109,7 +109,7 @@ options: - name: ANSIBLE_LOOKUP_URL_USE_GSSAPI ini: - section: url_lookup - - key: use_gssapi + key: use_gssapi unix_socket: description: String of file system path to unix socket file to use when establishing connection to the provided url type: string @@ -120,7 +120,7 @@ options: - name: ANSIBLE_LOOKUP_URL_UNIX_SOCKET ini: - section: url_lookup - - key: unix_socket + key: unix_socket ca_path: description: String of file system path to CA cert bundle to use type: string @@ -131,7 +131,7 @@ options: - name: ANSIBLE_LOOKUP_URL_CA_PATH ini: - section: url_lookup - - key: ca_path + key: ca_path unredirected_headers: description: A list of headers to not attach on a redirected request type: list @@ -142,7 +142,7 @@ options: - name: ANSIBLE_LOOKUP_URL_UNREDIR_HEADERS ini: - section: url_lookup - - key: unredirected_headers + key: unredirected_headers """ EXAMPLES = """ @@ -166,6 +166,8 @@ EXAMPLES = """ RETURN = """ _list: description: list of list of lines or content of url(s) + type: list + elements: str """ from ansible.errors import AnsibleError diff --git a/lib/ansible/plugins/lookup/varnames.py b/lib/ansible/plugins/lookup/varnames.py index 17c1789a651..6a3def37b57 100644 --- a/lib/ansible/plugins/lookup/varnames.py +++ b/lib/ansible/plugins/lookup/varnames.py @@ -4,8 +4,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: varnames - author: Ansible Core + name: varnames + author: Ansible Core Team version_added: "2.8" short_description: Lookup matching variable names description: diff --git a/lib/ansible/plugins/lookup/vars.py b/lib/ansible/plugins/lookup/vars.py index 5895b93f9fc..9e14735219e 100644 --- a/lib/ansible/plugins/lookup/vars.py +++ b/lib/ansible/plugins/lookup/vars.py @@ -4,8 +4,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: vars - author: Ansible Core + name: vars + author: Ansible Core Team version_added: "2.5" short_description: Lookup templated value of variables description: @@ -63,6 +63,8 @@ RETURN = """ _value: description: - value of the variables requested. + type: list + elements: raw """ from ansible.errors import AnsibleError, AnsibleUndefinedVariable diff --git a/lib/ansible/plugins/shell/cmd.py b/lib/ansible/plugins/shell/cmd.py index d83aa11515f..e73c6719548 100644 --- a/lib/ansible/plugins/shell/cmd.py +++ b/lib/ansible/plugins/shell/cmd.py @@ -5,7 +5,6 @@ __metaclass__ = type DOCUMENTATION = ''' name: cmd -plugin_type: shell version_added: '2.8' short_description: Windows Command Prompt description: diff --git a/lib/ansible/plugins/shell/powershell.py b/lib/ansible/plugins/shell/powershell.py index 64ea58249ee..11d1cfcc060 100644 --- a/lib/ansible/plugins/shell/powershell.py +++ b/lib/ansible/plugins/shell/powershell.py @@ -6,7 +6,6 @@ __metaclass__ = type DOCUMENTATION = ''' name: powershell -plugin_type: shell version_added: historical short_description: Windows PowerShell description: diff --git a/lib/ansible/plugins/shell/sh.py b/lib/ansible/plugins/shell/sh.py index 76a386f77a9..5b13a015a23 100644 --- a/lib/ansible/plugins/shell/sh.py +++ b/lib/ansible/plugins/shell/sh.py @@ -6,7 +6,6 @@ __metaclass__ = type DOCUMENTATION = ''' name: sh -plugin_type: shell short_description: "POSIX shell (/bin/sh)" version_added: historical description: diff --git a/lib/ansible/plugins/strategy/debug.py b/lib/ansible/plugins/strategy/debug.py index 5daea894b2e..f808bcfa0d2 100644 --- a/lib/ansible/plugins/strategy/debug.py +++ b/lib/ansible/plugins/strategy/debug.py @@ -16,12 +16,12 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - strategy: debug + name: debug short_description: Executes tasks in interactive debug session. description: - Task execution is 'linear' but controlled by an interactive debug session. version_added: "2.1" - author: Kishin Yagami + author: Kishin Yagami (!UNKNOWN) ''' import cmd diff --git a/lib/ansible/plugins/strategy/free.py b/lib/ansible/plugins/strategy/free.py index 7ed21183cf6..455aaa049ef 100644 --- a/lib/ansible/plugins/strategy/free.py +++ b/lib/ansible/plugins/strategy/free.py @@ -19,7 +19,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - strategy: free + name: free short_description: Executes tasks without waiting for all hosts description: - Task execution is as fast as possible per batch as defined by C(serial) (default all). diff --git a/lib/ansible/plugins/strategy/host_pinned.py b/lib/ansible/plugins/strategy/host_pinned.py index ba293d36513..70f22eb8497 100644 --- a/lib/ansible/plugins/strategy/host_pinned.py +++ b/lib/ansible/plugins/strategy/host_pinned.py @@ -19,7 +19,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - strategy: host_pinned + name: host_pinned short_description: Executes tasks on each host without interruption description: - Task execution is as fast as possible per host in batch as defined by C(serial) (default all). diff --git a/lib/ansible/plugins/strategy/linear.py b/lib/ansible/plugins/strategy/linear.py index ca70476e728..00458695173 100644 --- a/lib/ansible/plugins/strategy/linear.py +++ b/lib/ansible/plugins/strategy/linear.py @@ -19,7 +19,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - strategy: linear + name: linear short_description: Executes tasks in a linear fashion description: - Task execution is in lockstep per host batch as defined by C(serial) (default all). diff --git a/lib/ansible/plugins/vars/host_group_vars.py b/lib/ansible/plugins/vars/host_group_vars.py index 377a77de7a4..7bdfe332c80 100644 --- a/lib/ansible/plugins/vars/host_group_vars.py +++ b/lib/ansible/plugins/vars/host_group_vars.py @@ -19,7 +19,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - vars: host_group_vars + name: host_group_vars version_added: "2.4" short_description: In charge of loading group_vars and host_vars requirements: