Fix various sanity errors in plugins.
This commit is contained in:
parent
a10af345a9
commit
07250b074a
22 changed files with 45 additions and 12 deletions
|
@ -7,7 +7,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
callback: tree
|
callback: tree
|
||||||
callback_type: notification
|
type: notification
|
||||||
requirements:
|
requirements:
|
||||||
- invoked in the command line
|
- invoked in the command line
|
||||||
short_description: Save host events to files
|
short_description: Save host events to files
|
||||||
|
|
|
@ -6,7 +6,7 @@ __metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = """
|
DOCUMENTATION = """
|
||||||
author: Ansible Core Team
|
author: Ansible Core Team
|
||||||
connection: paramiko
|
connection: paramiko_ssh
|
||||||
short_description: Run tasks via python ssh (paramiko)
|
short_description: Run tasks via python ssh (paramiko)
|
||||||
description:
|
description:
|
||||||
- Use the python ssh implementation (Paramiko) to connect to targets
|
- Use the python ssh implementation (Paramiko) to connect to targets
|
||||||
|
|
|
@ -9,6 +9,7 @@ DOCUMENTATION = '''
|
||||||
plugin_type: inventory
|
plugin_type: inventory
|
||||||
author:
|
author:
|
||||||
- Matt Davis <@nitzmahone>
|
- Matt Davis <@nitzmahone>
|
||||||
|
version_added: "2.5"
|
||||||
short_description: Loads and executes an inventory plugin specified in a YAML config
|
short_description: Loads and executes an inventory plugin specified in a YAML config
|
||||||
description:
|
description:
|
||||||
- By whitelisting C(auto) inventory plugin, any YAML inventory config file with a
|
- By whitelisting C(auto) inventory plugin, any YAML inventory config file with a
|
||||||
|
|
|
@ -153,7 +153,7 @@ class InventoryModule(BaseFileInventoryPlugin):
|
||||||
NAME = 'toml'
|
NAME = 'toml'
|
||||||
|
|
||||||
def _parse_group(self, group, group_data):
|
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)
|
self.display.warning("Skipping '%s' as this is not a valid group definition" % group)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@ RETURN = """
|
||||||
_raw:
|
_raw:
|
||||||
description:
|
description:
|
||||||
- value(s) of the key(s) in the config
|
- value(s) of the key(s) in the config
|
||||||
|
type: raw
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from ansible import constants as C
|
from ansible import constants as C
|
||||||
|
|
|
@ -61,6 +61,8 @@ RETURN = """
|
||||||
_raw:
|
_raw:
|
||||||
description:
|
description:
|
||||||
- value(s) stored in file column
|
- value(s) stored in file column
|
||||||
|
type: list
|
||||||
|
elements: str
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
|
|
|
@ -45,6 +45,8 @@ RETURN = """
|
||||||
_raw:
|
_raw:
|
||||||
description:
|
description:
|
||||||
- content of file(s)
|
- content of file(s)
|
||||||
|
type: list
|
||||||
|
elements: str
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from ansible.errors import AnsibleError, AnsibleParserError
|
from ansible.errors import AnsibleError, AnsibleParserError
|
||||||
|
|
|
@ -41,6 +41,8 @@ RETURN = """
|
||||||
_list:
|
_list:
|
||||||
description:
|
description:
|
||||||
- list of files
|
- list of files
|
||||||
|
type: list
|
||||||
|
elements: path
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
|
@ -99,6 +99,8 @@ RETURN = """
|
||||||
_raw:
|
_raw:
|
||||||
description:
|
description:
|
||||||
- path to file found
|
- path to file found
|
||||||
|
type: list
|
||||||
|
elements: path
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ RETURN = """
|
||||||
description:
|
description:
|
||||||
- list with each item.0 giving you the position and item.1 the value
|
- list with each item.0 giving you the position and item.1 the value
|
||||||
type: list
|
type: list
|
||||||
|
elements: list
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from ansible.errors import AnsibleError
|
from ansible.errors import AnsibleError
|
||||||
|
|
|
@ -56,6 +56,8 @@ RETURN = """
|
||||||
_raw:
|
_raw:
|
||||||
description:
|
description:
|
||||||
- value(s) of the key(s) in the ini file
|
- value(s) of the key(s) in the ini file
|
||||||
|
type: list
|
||||||
|
elements: str
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
|
@ -37,6 +37,8 @@ RETURN = """
|
||||||
_list:
|
_list:
|
||||||
description:
|
description:
|
||||||
- lines of stdout from command
|
- lines of stdout from command
|
||||||
|
type: list
|
||||||
|
elements: str
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
|
@ -27,6 +27,8 @@ EXAMPLES = """
|
||||||
RETURN = """
|
RETURN = """
|
||||||
_list:
|
_list:
|
||||||
description: basically the same as you fed in
|
description: basically the same as you fed in
|
||||||
|
type: list
|
||||||
|
elements: raw
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.common._collections_compat import Sequence
|
from ansible.module_utils.common._collections_compat import Sequence
|
||||||
|
|
|
@ -95,6 +95,8 @@ RETURN = """
|
||||||
_raw:
|
_raw:
|
||||||
description:
|
description:
|
||||||
- a password
|
- a password
|
||||||
|
type: list
|
||||||
|
elements: str
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
|
@ -40,6 +40,8 @@ RETURN = r"""
|
||||||
_string:
|
_string:
|
||||||
description:
|
description:
|
||||||
- stdout from command
|
- stdout from command
|
||||||
|
type: list
|
||||||
|
elements: str
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
|
@ -30,6 +30,7 @@ RETURN = """
|
||||||
_raw:
|
_raw:
|
||||||
description:
|
description:
|
||||||
- random item
|
- random item
|
||||||
|
type: raw
|
||||||
"""
|
"""
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,7 @@ RETURN = """
|
||||||
description:
|
description:
|
||||||
- A list containing generated sequence of items
|
- A list containing generated sequence of items
|
||||||
type: list
|
type: list
|
||||||
|
elements: str
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from re import compile as re_compile, IGNORECASE
|
from re import compile as re_compile, IGNORECASE
|
||||||
|
|
|
@ -55,6 +55,8 @@ EXAMPLES = """
|
||||||
RETURN = """
|
RETURN = """
|
||||||
_raw:
|
_raw:
|
||||||
description: file(s) content after templating
|
description: file(s) content after templating
|
||||||
|
type: list
|
||||||
|
elements: raw
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
|
|
@ -32,6 +32,8 @@ EXAMPLES = """
|
||||||
RETURN = """
|
RETURN = """
|
||||||
_list:
|
_list:
|
||||||
description: synchronized list
|
description: synchronized list
|
||||||
|
type: list
|
||||||
|
elements: list
|
||||||
"""
|
"""
|
||||||
from ansible.errors import AnsibleError
|
from ansible.errors import AnsibleError
|
||||||
from ansible.module_utils.six.moves import zip_longest
|
from ansible.module_utils.six.moves import zip_longest
|
||||||
|
|
|
@ -26,6 +26,8 @@ RETURN = """
|
||||||
_raw:
|
_raw:
|
||||||
description:
|
description:
|
||||||
- content of file(s) as bytes
|
- content of file(s) as bytes
|
||||||
|
type: list
|
||||||
|
elements: raw
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from ansible.errors import AnsibleParserError
|
from ansible.errors import AnsibleParserError
|
||||||
|
|
|
@ -50,7 +50,7 @@ options:
|
||||||
- name: ANSIBLE_LOOKUP_URL_FORCE
|
- name: ANSIBLE_LOOKUP_URL_FORCE
|
||||||
ini:
|
ini:
|
||||||
- section: url_lookup
|
- section: url_lookup
|
||||||
- key: force
|
key: force
|
||||||
timeout:
|
timeout:
|
||||||
description: How long to wait for the server to send data before giving up
|
description: How long to wait for the server to send data before giving up
|
||||||
type: float
|
type: float
|
||||||
|
@ -62,7 +62,7 @@ options:
|
||||||
- name: ANSIBLE_LOOKUP_URL_TIMEOUT
|
- name: ANSIBLE_LOOKUP_URL_TIMEOUT
|
||||||
ini:
|
ini:
|
||||||
- section: url_lookup
|
- section: url_lookup
|
||||||
- key: timeout
|
key: timeout
|
||||||
http_agent:
|
http_agent:
|
||||||
description: User-Agent to use in the request
|
description: User-Agent to use in the request
|
||||||
type: string
|
type: string
|
||||||
|
@ -73,7 +73,7 @@ options:
|
||||||
- name: ANSIBLE_LOOKUP_URL_AGENT
|
- name: ANSIBLE_LOOKUP_URL_AGENT
|
||||||
ini:
|
ini:
|
||||||
- section: url_lookup
|
- section: url_lookup
|
||||||
- key: agent
|
key: agent
|
||||||
force_basic_auth:
|
force_basic_auth:
|
||||||
description: Force basic authentication
|
description: Force basic authentication
|
||||||
type: boolean
|
type: boolean
|
||||||
|
@ -85,7 +85,7 @@ options:
|
||||||
- name: ANSIBLE_LOOKUP_URL_AGENT
|
- name: ANSIBLE_LOOKUP_URL_AGENT
|
||||||
ini:
|
ini:
|
||||||
- section: url_lookup
|
- section: url_lookup
|
||||||
- key: agent
|
key: agent
|
||||||
follow_redirects:
|
follow_redirects:
|
||||||
description: String of urllib2, all/yes, safe, none to determine how redirects are followed, see RedirectHandlerFactory for more information
|
description: String of urllib2, all/yes, safe, none to determine how redirects are followed, see RedirectHandlerFactory for more information
|
||||||
type: string
|
type: string
|
||||||
|
@ -97,7 +97,7 @@ options:
|
||||||
- name: ANSIBLE_LOOKUP_URL_FOLLOW_REDIRECTS
|
- name: ANSIBLE_LOOKUP_URL_FOLLOW_REDIRECTS
|
||||||
ini:
|
ini:
|
||||||
- section: url_lookup
|
- section: url_lookup
|
||||||
- key: follow_redirects
|
key: follow_redirects
|
||||||
use_gssapi:
|
use_gssapi:
|
||||||
description: Use GSSAPI handler of requests
|
description: Use GSSAPI handler of requests
|
||||||
type: boolean
|
type: boolean
|
||||||
|
@ -109,7 +109,7 @@ options:
|
||||||
- name: ANSIBLE_LOOKUP_URL_USE_GSSAPI
|
- name: ANSIBLE_LOOKUP_URL_USE_GSSAPI
|
||||||
ini:
|
ini:
|
||||||
- section: url_lookup
|
- section: url_lookup
|
||||||
- key: use_gssapi
|
key: use_gssapi
|
||||||
unix_socket:
|
unix_socket:
|
||||||
description: String of file system path to unix socket file to use when establishing connection to the provided url
|
description: String of file system path to unix socket file to use when establishing connection to the provided url
|
||||||
type: string
|
type: string
|
||||||
|
@ -120,7 +120,7 @@ options:
|
||||||
- name: ANSIBLE_LOOKUP_URL_UNIX_SOCKET
|
- name: ANSIBLE_LOOKUP_URL_UNIX_SOCKET
|
||||||
ini:
|
ini:
|
||||||
- section: url_lookup
|
- section: url_lookup
|
||||||
- key: unix_socket
|
key: unix_socket
|
||||||
ca_path:
|
ca_path:
|
||||||
description: String of file system path to CA cert bundle to use
|
description: String of file system path to CA cert bundle to use
|
||||||
type: string
|
type: string
|
||||||
|
@ -131,7 +131,7 @@ options:
|
||||||
- name: ANSIBLE_LOOKUP_URL_CA_PATH
|
- name: ANSIBLE_LOOKUP_URL_CA_PATH
|
||||||
ini:
|
ini:
|
||||||
- section: url_lookup
|
- section: url_lookup
|
||||||
- key: ca_path
|
key: ca_path
|
||||||
unredirected_headers:
|
unredirected_headers:
|
||||||
description: A list of headers to not attach on a redirected request
|
description: A list of headers to not attach on a redirected request
|
||||||
type: list
|
type: list
|
||||||
|
@ -142,7 +142,7 @@ options:
|
||||||
- name: ANSIBLE_LOOKUP_URL_UNREDIR_HEADERS
|
- name: ANSIBLE_LOOKUP_URL_UNREDIR_HEADERS
|
||||||
ini:
|
ini:
|
||||||
- section: url_lookup
|
- section: url_lookup
|
||||||
- key: unredirected_headers
|
key: unredirected_headers
|
||||||
"""
|
"""
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
|
@ -166,6 +166,8 @@ EXAMPLES = """
|
||||||
RETURN = """
|
RETURN = """
|
||||||
_list:
|
_list:
|
||||||
description: list of list of lines or content of url(s)
|
description: list of list of lines or content of url(s)
|
||||||
|
type: list
|
||||||
|
elements: str
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from ansible.errors import AnsibleError
|
from ansible.errors import AnsibleError
|
||||||
|
|
|
@ -63,6 +63,8 @@ RETURN = """
|
||||||
_value:
|
_value:
|
||||||
description:
|
description:
|
||||||
- value of the variables requested.
|
- value of the variables requested.
|
||||||
|
type: list
|
||||||
|
elements: raw
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from ansible.errors import AnsibleError, AnsibleUndefinedVariable
|
from ansible.errors import AnsibleError, AnsibleUndefinedVariable
|
||||||
|
|
Loading…
Reference in a new issue