Port ansible doc for plugins to use DOCUMENTATION variables

* Using docstrings conflicts with the standard use of docstrings
* PYTHON_OPTIMIZE=2 will omit docstrings.  Using docstrings makes future
  changes to the plugin and module code subject to the requirement that we
  ensure it won't be run with optimization.
pull/29883/head
Toshio Kuratomi 7 years ago
parent 9bc330c89b
commit cc343a4376

@ -24,18 +24,6 @@ def read_docstring(filename, verbose=True, ignore_errors=True):
Parse DOCUMENTATION from YAML and return the YAML doc or None together with EXAMPLES, as plain text. Parse DOCUMENTATION from YAML and return the YAML doc or None together with EXAMPLES, as plain text.
""" """
# FIXME: Should refactor this so that we have a docstring parsing
# function and a separate variable parsing function
# Can have a function one higher that invokes whichever is needed
#
# Should look roughly like this:
# get_plugin_doc(filename, verbose=False)
# documentation = extract_docstring(plugin_ast, identifier, verbose=False)
# if not documentation and not (filter or test):
# documentation = extract_variables(plugin_ast)
# documentation['metadata'] = extract_metadata(plugin_ast)
# return documentation
data = { data = {
'doc': None, 'doc': None,
'plainexamples': None, 'plainexamples': None,
@ -52,18 +40,7 @@ def read_docstring(filename, verbose=True, ignore_errors=True):
try: try:
b_module_data = open(filename, 'rb').read() b_module_data = open(filename, 'rb').read()
M = ast.parse(b_module_data) M = ast.parse(b_module_data)
try:
display.debug('Attempt first docstring is yaml docs')
docstring = yaml.load(M.body[0].value.s)
for string in string_to_vars.keys():
if string in docstring:
data[string_to_vars[string]] = docstring[string]
display.debug('assigned :%s' % string_to_vars[string])
except Exception as e:
display.debug('failed docstring parsing: %s' % str(e))
if 'docs' not in data or not data['docs']:
display.debug('Fallback to vars parsing')
for child in M.body: for child in M.body:
if isinstance(child, ast.Assign): if isinstance(child, ast.Assign):
for t in child.targets: for t in child.targets:

@ -2,8 +2,11 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
cache: jsonfile cache: jsonfile
short_description: JSON formatted files. short_description: JSON formatted files.
description: description:
@ -39,10 +42,6 @@ DOCUMENTATION:
type: integer type: integer
''' '''
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import codecs import codecs
try: try:

@ -2,8 +2,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
cache: memcached cache: memcached
short_description: Use memcached DB for cache short_description: Use memcached DB for cache
description: description:
@ -40,9 +42,6 @@ DOCUMENTATION:
type: integer type: integer
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import collections import collections
import os import os
import time import time

@ -2,8 +2,11 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
'''
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
cache: memory cache: memory
short_description: RAM backed, non persistent short_description: RAM backed, non persistent
description: description:
@ -14,10 +17,6 @@ DOCUMENTATION:
author: core team (@ansible-core) author: core team (@ansible-core)
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.cache import BaseCacheModule from ansible.plugins.cache import BaseCacheModule

@ -2,8 +2,11 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
cache: pickle cache: pickle
short_description: Pickle formatted files. short_description: Pickle formatted files.
description: description:
@ -38,10 +41,6 @@ DOCUMENTATION:
section: defaults section: defaults
''' '''
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
try: try:
import cPickle as pickle import cPickle as pickle
except ImportError: except ImportError:

@ -1,8 +1,10 @@
# (c) 2014, Brian Coca, Josh Drake, et al # (c) 2014, Brian Coca, Josh Drake, et al
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
cache: redis cache: redis
short_description: Use Redis DB for cache short_description: Use Redis DB for cache
description: description:
@ -37,8 +39,6 @@ DOCUMENTATION:
section: defaults section: defaults
type: integer type: integer
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import time import time
import json import json

@ -2,8 +2,11 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
cache: yaml cache: yaml
short_description: YAML formatted files. short_description: YAML formatted files.
description: description:
@ -39,10 +42,6 @@ DOCUMENTATION:
type: integer type: integer
''' '''
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import codecs import codecs

@ -2,8 +2,11 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: actionable callback: actionable
type: stdout type: stdout
short_description: shows only items that need attention short_description: shows only items that need attention
@ -14,9 +17,6 @@ DOCUMENTATION:
requirements: requirements:
- set as stdout callback in configuration - set as stdout callback in configuration
''' '''
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default from ansible.plugins.callback.default import CallbackModule as CallbackModule_default

@ -2,8 +2,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
callback: context_demo callback: context_demo
type: aggregate type: aggregate
short_description: demo callback that adds play/task context short_description: demo callback that adds play/task context
@ -15,9 +17,6 @@ DOCUMENTATION:
- whitelist in configuration - whitelist in configuration
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback import CallbackBase from ansible.plugins.callback import CallbackBase

@ -1,8 +1,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
callback: debug callback: debug
type: stdout type: stdout
short_description: formated stdout/stderr display short_description: formated stdout/stderr display
@ -12,8 +14,6 @@ DOCUMENTATION:
requirements: requirements:
- set as stdout in configuration - set as stdout in configuration
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default from ansible.plugins.callback.default import CallbackModule as CallbackModule_default

@ -2,8 +2,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
callback: default callback: default
type: stdout type: stdout
short_description: default Ansible screen output short_description: default Ansible screen output
@ -35,9 +37,6 @@ DOCUMENTATION:
- set as stdout in configuration - set as stdout in configuration
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible import constants as C from ansible import constants as C
from ansible.playbook.task_include import TaskInclude from ansible.playbook.task_include import TaskInclude
from ansible.plugins.callback import CallbackBase from ansible.plugins.callback import CallbackBase

@ -2,8 +2,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
callback: dense callback: dense
type: stdout type: stdout
short_description: minimal stdout output short_description: minimal stdout output
@ -13,8 +15,6 @@ DOCUMENTATION:
requirements: requirements:
- set as stdout in configuation - set as stdout in configuation
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from collections import MutableMapping, MutableSequence from collections import MutableMapping, MutableSequence

@ -4,8 +4,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
callback: foreman callback: foreman
type: notification type: notification
short_description: Sends events to Foreman short_description: Sends events to Foreman
@ -38,9 +40,6 @@ DOCUMENTATION:
- name: FOREMAN_SSL_VERIFY - name: FOREMAN_SSL_VERIFY
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
from datetime import datetime from datetime import datetime
from collections import defaultdict from collections import defaultdict

@ -2,8 +2,11 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: full_skip callback: full_skip
type: stdout type: stdout
short_description: suppreses tasks if all hosts skipped short_description: suppreses tasks if all hosts skipped
@ -13,9 +16,6 @@ DOCUMENTATION:
requirements: requirements:
- set as stdout in configuation - set as stdout in configuation
''' '''
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default from ansible.plugins.callback.default import CallbackModule as CallbackModule_default

@ -2,8 +2,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
callback: hipchat callback: hipchat
type: notification type: notification
short_description: post task events to hipchat short_description: post task events to hipchat
@ -37,9 +39,6 @@ DOCUMENTATION:
- name: HIPCHAT_NOTIFY - name: HIPCHAT_NOTIFY
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
try: try:

@ -2,8 +2,10 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
callback: jabber callback: jabber
type: notification type: notification
short_description: post task events to a jabber server short_description: post task events to a jabber server
@ -36,9 +38,6 @@ DOCUMENTATION:
- name: JABBER_TO - name: JABBER_TO
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
HAS_XMPP = True HAS_XMPP = True

@ -2,8 +2,11 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: json callback: json
short_description: Ansbile screen output as JSON short_description: Ansbile screen output as JSON
version_added: "2.2" version_added: "2.2"
@ -14,10 +17,6 @@ DOCUMENTATION:
- Set as stdout in config - Set as stdout in config
''' '''
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json import json
from ansible.plugins.callback import CallbackBase from ansible.plugins.callback import CallbackBase

@ -2,8 +2,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
callback: junit callback: junit
type: aggregate type: aggregate
short_description: write playbook output to a JUnit file. short_description: write playbook output to a JUnit file.
@ -40,9 +42,6 @@ DOCUMENTATION:
- junit_xml (python lib) - junit_xml (python lib)
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
import time import time
import re import re

@ -2,8 +2,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
callback: log_plays callback: log_plays
type: notification type: notification
short_description: write playbook output to log file short_description: write playbook output to log file
@ -16,9 +18,6 @@ DOCUMENTATION:
- A writeable /var/log/ansible/hosts directory by the user executing Ansbile on the controller - A writeable /var/log/ansible/hosts directory by the user executing Ansbile on the controller
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
import time import time
import json import json

@ -1,9 +1,10 @@
# (c) 2015, Logentries.com, Jimmy Tang <jimmy.tang@logentries.com> # (c) 2015, Logentries.com, Jimmy Tang <jimmy.tang@logentries.com>
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
''' DOCUMENTATION = '''
DOCUMENTATION:
callback: logentries callback: logentries
type: notification type: notification
short_description: Sends events to Logentries short_description: Sends events to Logentries
@ -68,7 +69,10 @@ DOCUMENTATION:
ini: ini:
- section: callback_logentries - section: callback_logentries
key: flatten key: flatten
EXAMPLES: > '''
EXAMPLES = '''
examples: >
To enable, add this to your ansible.cfg file in the defaults block To enable, add this to your ansible.cfg file in the defaults block
[defaults] [defaults]
@ -88,8 +92,6 @@ EXAMPLES: >
token = dd21fc88-f00a-43ff-b977-e3a4233c53af token = dd21fc88-f00a-43ff-b977-e3a4233c53af
flatten = False flatten = False
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
import socket import socket
@ -112,10 +114,9 @@ except ImportError:
from ansible.errors import AnsibleError from ansible.errors import AnsibleError
from ansible.module_utils._text import to_bytes, to_text, to_native from ansible.module_utils._text import to_bytes, to_text, to_native
from ansible.plugins.callback import CallbackBase from ansible.plugins.callback import CallbackBase
"""
Todo: # Todo:
* Better formatting of output before sending out to logentries data/api nodes. # * Better formatting of output before sending out to logentries data/api nodes.
"""
class PlainTextSocketAppender(object): class PlainTextSocketAppender(object):

@ -2,8 +2,10 @@
# (C) 2017 Ansible Project # (C) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
callback: logstash callback: logstash
type: notification type: notification
short_description: Sends events to Logstash short_description: Sends events to Logstash
@ -31,9 +33,6 @@ DOCUMENTATION:
default: ansible default: ansible
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
import json import json
import socket import socket

@ -2,8 +2,10 @@
# Copyright: (c) 2012, Dag Wieers <dag@wieers.com> # Copyright: (c) 2012, Dag Wieers <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
callback: mail callback: mail
type: notification type: notification
short_description: Sends failure events via email short_description: Sends failure events via email
@ -23,9 +25,6 @@ DOCUMENTATION:
- "TODO: expand configuration options now that plugins can leverage Ansible's configuration" - "TODO: expand configuration options now that plugins can leverage Ansible's configuration"
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json import json
import os import os
import smtplib import smtplib

@ -2,8 +2,11 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: minimal callback: minimal
type: stdout type: stdout
short_description: minimal Ansible screen output short_description: minimal Ansible screen output
@ -12,11 +15,6 @@ DOCUMENTATION:
- This is the default output callback used by the ansible command (ad-hoc) - This is the default output callback used by the ansible command (ad-hoc)
''' '''
# Make coding more python3-ish
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback import CallbackBase from ansible.plugins.callback import CallbackBase
from ansible import constants as C from ansible import constants as C

@ -2,8 +2,11 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: oneline callback: oneline
type: stdout type: stdout
short_description: oneline Ansible screen output short_description: oneline Ansible screen output
@ -12,10 +15,6 @@ DOCUMENTATION:
- This is the output callback used by the -o/--one-line command line option. - This is the output callback used by the -o/--one-line command line option.
''' '''
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback import CallbackBase from ansible.plugins.callback import CallbackBase
from ansible import constants as C from ansible import constants as C

@ -2,8 +2,11 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: osx_say callback: osx_say
type: notification type: notification
requirements: requirements:
@ -15,10 +18,6 @@ DOCUMENTATION:
- This plugin will use the 'say' program to "speak" about play events. - This plugin will use the 'say' program to "speak" about play events.
''' '''
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import subprocess import subprocess
import os import os

@ -2,8 +2,11 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: profile_roles callback: profile_roles
type: aggregate type: aggregate
short_description: adds timing information to roles short_description: adds timing information to roles
@ -14,12 +17,6 @@ DOCUMENTATION:
- whitelisting in configuration - whitelisting in configuration
''' '''
# Make coding more python3-ish
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import collections import collections
import time import time

@ -5,8 +5,11 @@
# (C) 2017 Ansible Project # (C) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: profile_tasks callback: profile_tasks
type: aggregate type: aggregate
short_description: adds time information to tasks short_description: adds time information to tasks
@ -38,7 +41,9 @@ DOCUMENTATION:
ini: ini:
- section: callback_profile_tasks - section: callback_profile_tasks
key: sort_order key: sort_order
#EXAMPLES: > ' '''
EXAMPLES = '''
# #
# TASK: [ensure messaging security group exists] ******************************** # TASK: [ensure messaging security group exists] ********************************
# Thursday 11 June 2017 22:50:53 +0100 (0:00:00.721) 0:00:05.322 ********* # Thursday 11 June 2017 22:50:53 +0100 (0:00:00.721) 0:00:05.322 *********
@ -50,11 +55,6 @@ DOCUMENTATION:
# ' # '
''' '''
# Make coding more python3-ish
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import collections import collections
import time import time

@ -2,8 +2,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
callback: selective callback: selective
callback_type: stdout callback_type: stdout
requirements: requirements:
@ -26,21 +28,20 @@ DOCUMENTATION:
- section: defaults - section: defaults
- key: nocolor - key: nocolor
type: boolean type: boolean
EXAMPLES: """
EXAMPLES = """
- debug: msg="This will not be printed" - debug: msg="This will not be printed"
- debug: msg="But this will" - debug: msg="But this will"
tags: [print_action] tags: [print_action]
""" """
from __future__ import (absolute_import, division, print_function)
import difflib import difflib
from ansible import constants as C from ansible import constants as C
from ansible.plugins.callback import CallbackBase from ansible.plugins.callback import CallbackBase
from ansible.module_utils._text import to_text from ansible.module_utils._text import to_text
__metaclass__ = type
DONT_COLORIZE = False DONT_COLORIZE = False
COLORS = { COLORS = {

@ -2,8 +2,11 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: skippy callback: skippy
callback_type: stdout callback_type: stdout
requirements: requirements:
@ -14,10 +17,6 @@ DOCUMENTATION:
- This callback does the same as the default except it does not output skipped host/task/item status - This callback does the same as the default except it does not output skipped host/task/item status
''' '''
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default from ansible.plugins.callback.default import CallbackModule as CallbackModule_default

@ -2,8 +2,11 @@
# (C) 2017 Ansible Project # (C) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: slack callback: slack
callback_type: notification callback_type: notification
requirements: requirements:
@ -40,9 +43,6 @@ DOCUMENTATION:
- section: callback_slack - section: callback_slack
key: username key: username
''' '''
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json import json
import os import os

@ -2,8 +2,11 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: stderr callback: stderr
callback_type: stdout callback_type: stdout
requirements: requirements:
@ -14,9 +17,6 @@ DOCUMENTATION:
- This is the stderr callback plugin, it behaves like the default callback plugin but sends error output to stderr. - This is the stderr callback plugin, it behaves like the default callback plugin but sends error output to stderr.
- Also it does not output skipped host/task/item status - Also it does not output skipped host/task/item status
''' '''
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible import constants as C from ansible import constants as C
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default from ansible.plugins.callback.default import CallbackModule as CallbackModule_default

@ -1,8 +1,11 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: syslog_json callback: syslog_json
callback_type: notification callback_type: notification
requirements: requirements:
@ -39,10 +42,6 @@ DOCUMENTATION:
key: syslog_facility key: syslog_facility
''' '''
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
import json import json

@ -1,7 +1,11 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
'''
DOCUMENTATION: # Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: timer callback: timer
callback_type: aggregate callback_type: aggregate
requirements: requirements:
@ -11,9 +15,6 @@ DOCUMENTATION:
description: description:
- This callback just adds total play duration to the play stats. - This callback just adds total play duration to the play stats.
''' '''
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from datetime import datetime from datetime import datetime

@ -1,8 +1,11 @@
# (c) 2012-2014, Ansible, Inc # (c) 2012-2014, Ansible, Inc
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
'''
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: tree callback: tree
callback_type: notification callback_type: notification
requirements: requirements:
@ -13,8 +16,6 @@ DOCUMENTATION:
- "This callback is used by the Ansible (adhoc) command line option `-t|--tree`" - "This callback is used by the Ansible (adhoc) command line option `-t|--tree`"
- This produces a JSON dump of events in a directory, a file for each host, the directory used MUST be passed as a commadn line option. - This produces a JSON dump of events in a directory, a file for each host, the directory used MUST be passed as a commadn line option.
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os

@ -14,8 +14,10 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: Ansible Core Team author: Ansible Core Team
connection: accelerate connection: accelerate
short_description: Temporary 0mq agent short_description: Temporary 0mq agent
@ -27,9 +29,6 @@ DOCUMENTATION:
alternative: paramiko and ssh with conrol persistence. alternative: paramiko and ssh with conrol persistence.
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import base64 import base64
import json import json
import os import os

@ -7,8 +7,11 @@
# #
# Written by: Tomas Tomecek (https://github.com/TomasTomecek) # Written by: Tomas Tomecek (https://github.com/TomasTomecek)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
connection: buildah connection: buildah
short_description: Interact with an existing buildah container short_description: Interact with an existing buildah container
description: description:
@ -38,8 +41,6 @@ DOCUMENTATION:
# - name: remote_user # - name: remote_user
""" """
from __future__ import (absolute_import, division, print_function)
import shlex import shlex
import shutil import shutil
@ -57,9 +58,6 @@ except ImportError:
display = Display() display = Display()
__metaclass__ = type
# this _has to be_ named Connection # this _has to be_ named Connection
class Connection(ConnectionBase): class Connection(ConnectionBase):
""" """

@ -5,8 +5,10 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: Maykel Moya <mmoya@speedyrails.com> author: Maykel Moya <mmoya@speedyrails.com>
connection: chroot connection: chroot
short_description: Interact with local chroot short_description: Interact with local chroot
@ -32,9 +34,6 @@ DOCUMENTATION:
- name: ansible_executable - name: ansible_executable
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import distutils.spawn import distutils.spawn
import os import os
import os.path import os.path

@ -6,8 +6,10 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: author:
- Lorin Hochestein - Lorin Hochestein
- Leendert Brouwer - Leendert Brouwer
@ -37,9 +39,6 @@ DOCUMENTATION:
- name: ansible_docker_host - name: ansible_docker_host
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import distutils.spawn import distutils.spawn
import os import os
import os.path import os.path

@ -4,8 +4,10 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: Michael Scherer (@msherer) <misc@zarb.org> author: Michael Scherer (@msherer) <misc@zarb.org>
connection: funcd connection: funcd
short_description: Use funcd to connect to target short_description: Use funcd to connect to target
@ -23,8 +25,6 @@ DOCUMENTATION:
- name: ansible_host - name: ansible_host
- name: ansible_func_host - name: ansible_func_host
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
HAVE_FUNC = False HAVE_FUNC = False
try: try:

@ -5,8 +5,10 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: Stephan Lohse <dev-github@ploek.org> author: Stephan Lohse <dev-github@ploek.org>
connection: iocage connection: iocage
short_description: Run tasks in iocage jails short_description: Run tasks in iocage jails
@ -28,8 +30,6 @@ DOCUMENTATION:
- name: ansible_user - name: ansible_user
- name: ansible_iocage_user - name: ansible_iocage_user
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import subprocess import subprocess
from ansible.plugins.connection.jail import Connection as Jail from ansible.plugins.connection.jail import Connection as Jail

@ -5,8 +5,10 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: Ansible Core Team author: Ansible Core Team
connection: jail connection: jail
short_description: Run tasks in jails short_description: Run tasks in jails
@ -29,9 +31,6 @@ DOCUMENTATION:
- name: ansible_jail_user - name: ansible_jail_user
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import distutils.spawn import distutils.spawn
import os import os
import os.path import os.path

@ -5,8 +5,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: Michael Scherer <misc@zarb.org> author: Michael Scherer <misc@zarb.org>
connection: libvirt_lxc connection: libvirt_lxc
short_description: Run tasks in lxc containers via libvirt short_description: Run tasks in lxc containers via libvirt
@ -23,9 +25,6 @@ DOCUMENTATION:
- name: ansible_libvirt_lxc_host - name: ansible_libvirt_lxc_host
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import distutils.spawn import distutils.spawn
import os import os
import os.path import os.path

@ -15,8 +15,10 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
connection: local connection: local
short_description: execute on controller short_description: execute on controller
description: description:
@ -27,9 +29,6 @@ DOCUMENTATION:
- The remote user is ignored, the user with which the ansible CLI was executed is used instead. - The remote user is ignored, the user with which the ansible CLI was executed is used instead.
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
import shutil import shutil
import subprocess import subprocess

@ -2,8 +2,10 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: Joerg Thalheim <joerg@higgsboson.tk> author: Joerg Thalheim <joerg@higgsboson.tk>
connection: lxc connection: lxc
short_description: Run tasks in lxc containers via lxc python library short_description: Run tasks in lxc containers via lxc python library
@ -27,9 +29,6 @@ DOCUMENTATION:
- name: ansible_lxc_executable - name: ansible_lxc_executable
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
import shutil import shutil
import traceback import traceback

@ -2,8 +2,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: Matt Clay <matt@mystile.com> author: Matt Clay <matt@mystile.com>
connection: lxd connection: lxd
short_description: Run tasks in lxc containers via lxc CLI short_description: Run tasks in lxc containers via lxc CLI
@ -27,9 +29,6 @@ DOCUMENTATION:
- name: ansible_lxd_executable - name: ansible_lxd_executable
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
from distutils.spawn import find_executable from distutils.spawn import find_executable
from subprocess import call, Popen, PIPE from subprocess import call, Popen, PIPE

@ -2,8 +2,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: Ansible Networking Team author: Ansible Networking Team
connection: netconf connection: netconf
short_description: Use netconf to run command on network appliances short_description: Use netconf to run command on network appliances
@ -66,8 +68,6 @@ DOCUMENTATION:
#look_for_keys=C.PARAMIKO_LOOK_FOR_KEYS, #look_for_keys=C.PARAMIKO_LOOK_FOR_KEYS,
#allow_agent=self.allow_agent, #allow_agent=self.allow_agent,
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
import logging import logging

@ -2,8 +2,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: Ansible Networking Team author: Ansible Networking Team
connection: network_cli connection: network_cli
short_description: Use network_cli to run command on network appliances short_description: Use network_cli to run command on network appliances
@ -42,9 +44,6 @@ DOCUMENTATION:
default: 120 default: 120
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json import json
import logging import logging
import re import re

@ -1,8 +1,10 @@
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: Ansible Core Team author: Ansible Core Team
connection: paramiko connection: paramiko
short_description: Run tasks via python ssh (paramiko) short_description: Run tasks via python ssh (paramiko)
@ -47,8 +49,6 @@ DOCUMENTATION:
#C.PARAMIKO_PTY #C.PARAMIKO_PTY
#C.PARAMIKO_RECORD_HOST_KEYS #C.PARAMIKO_RECORD_HOST_KEYS
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import warnings import warnings
import os import os

@ -2,8 +2,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: Ansible Core Team author: Ansible Core Team
connection: persistent connection: persistent
short_description: Use a persistent unix socket for connection short_description: Use a persistent unix socket for connection
@ -12,9 +14,6 @@ DOCUMENTATION:
version_added: "2.3" version_added: "2.3"
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re import re
import os import os
import pty import pty

@ -5,8 +5,10 @@
# (c) 2017 Ansible Project # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: Michael Scherer <misc@zarb.org> author: Michael Scherer <misc@zarb.org>
connection: saltstack connection: saltstack
short_description: Allow ansible to piggyback on salt minions short_description: Allow ansible to piggyback on salt minions
@ -15,9 +17,6 @@ DOCUMENTATION:
version_added: "2.2" version_added: "2.2"
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re import re
import os import os
import pty import pty

@ -4,8 +4,10 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
connection: ssh connection: ssh
short_description: connect via ssh client binary short_description: connect via ssh client binary
description: description:
@ -169,9 +171,6 @@ DOCUMENTATION:
- {key: scp_if_ssh, section: ssh_connection} - {key: scp_if_ssh, section: ssh_connection}
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import errno import errno
import fcntl import fcntl
import hashlib import hashlib

@ -2,8 +2,10 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: Ansible Core Team author: Ansible Core Team
connection: winrm connection: winrm
short_description: Run tasks over Microsoft's WinRM short_description: Run tasks over Microsoft's WinRM
@ -26,9 +28,6 @@ DOCUMENTATION:
- name: ansible_winrm_user - name: ansible_winrm_user
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import base64 import base64
import inspect import inspect
import os import os

@ -6,8 +6,10 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
author: Ansible Core Team author: Ansible Core Team
connection: zone connection: zone
short_description: Run tasks in a zone instance short_description: Run tasks in a zone instance
@ -24,9 +26,6 @@ DOCUMENTATION:
- name: ansible_zone_host - name: ansible_zone_host
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import distutils.spawn import distutils.spawn
import os import os
import os.path import os.path

@ -1,25 +1,26 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
inventory: advanced_host_list inventory: advanced_host_list
version_added: "2.4" version_added: "2.4"
short_description: Parses a 'host list' with ranges short_description: Parses a 'host list' with ranges
description: description:
- Parses a host list string as a comma separated values of hosts and supports host ranges. - Parses a host list string as a comma separated values of hosts and supports host ranges.
- This plugin only applies to inventory sources that are not paths and contain at least one comma. - This plugin only applies to inventory sources that are not paths and contain at least one comma.
EXAMPLES: | '''
EXAMPLES = '''
# simple range # simple range
ansible -i 'host[1:10],' -m ping # ansible -i 'host[1:10],' -m ping
# still supports w/o ranges also # still supports w/o ranges also
ansible-playbook -i 'localhost,' play.yml # ansible-playbook -i 'localhost,' play.yml
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
from ansible.errors import AnsibleError, AnsibleParserError from ansible.errors import AnsibleError, AnsibleParserError

@ -1,8 +1,10 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
name: constructed name: constructed
plugin_type: inventory plugin_type: inventory
version_added: "2.4" version_added: "2.4"
@ -15,7 +17,10 @@ DOCUMENTATION:
- Failed expressions will be ignored (assumes vars were missing). - Failed expressions will be ignored (assumes vars were missing).
extends_documentation_fragment: extends_documentation_fragment:
- constructed - constructed
EXAMPLES: | # inventory.config file in YAML format '''
EXAMPLES = '''
# inventory.config file in YAML format
plugin: comstructed plugin: comstructed
compose: compose:
var_sum: var1 + var2 var_sum: var1 + var2
@ -42,9 +47,6 @@ EXAMPLES: | # inventory.config file in YAML format
key: ec2_architecture key: ec2_architecture
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
from ansible.errors import AnsibleParserError from ansible.errors import AnsibleParserError

@ -1,28 +1,29 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
r''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = r'''
inventory: host_list inventory: host_list
version_added: "2.4" version_added: "2.4"
short_description: Parses a 'host list' string short_description: Parses a 'host list' string
description: description:
- Parses a host list string as a comma separated values of hosts - Parses a host list string as a comma separated values of hosts
- This plugin only applies to inventory strings that are not paths and contain a comma. - This plugin only applies to inventory strings that are not paths and contain a comma.
EXAMPLES: | '''
EXAMPLES = r'''
# define 2 hosts in command line # define 2 hosts in command line
ansible -i '10.10.2.6, 10.10.2.4' -m ping all # ansible -i '10.10.2.6, 10.10.2.4' -m ping all
# DNS resolvable names # DNS resolvable names
ansible -i 'host1.example.com, host2' -m user -a 'name=me state=absent' all # ansible -i 'host1.example.com, host2' -m user -a 'name=me state=absent' all
# just use localhost # just use localhost
ansible-playbook -i 'localhost,' play.yml -c local # ansible-playbook -i 'localhost,' play.yml -c local
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
from ansible.errors import AnsibleError, AnsibleParserError from ansible.errors import AnsibleError, AnsibleParserError

@ -1,8 +1,9 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
''' DOCUMENTATION = '''
DOCUMENTATION:
inventory: ini inventory: ini
version_added: "2.4" version_added: "2.4"
short_description: Uses an Ansible INI file as inventory source. short_description: Uses an Ansible INI file as inventory source.
@ -19,8 +20,9 @@ DOCUMENTATION:
notes: notes:
- It takes the place of the previously hardcoded INI inventory. - It takes the place of the previously hardcoded INI inventory.
- To function it requires being whitelisted in configuration. - To function it requires being whitelisted in configuration.
'''
EXAMPLES: EXAMPLES = '''
example1: | example1: |
# example cfg file # example cfg file
[web] [web]
@ -63,8 +65,6 @@ EXAMPLES:
host4 # same host as above, but member of 2 groups, will inherit vars from both host4 # same host as above, but member of 2 groups, will inherit vars from both
# inventory hostnames are unique # inventory hostnames are unique
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import ast import ast
import re import re

@ -5,8 +5,10 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
name: openstack name: openstack
plugin_type: inventory plugin_type: inventory
short_description: OpenStack inventory source short_description: OpenStack inventory source
@ -84,7 +86,9 @@ DOCUMENTATION:
description: Add hosts to group based on Jinja2 conditionals. description: Add hosts to group based on Jinja2 conditionals.
type: dictionary type: dictionary
default: {} default: {}
EXAMPLES: '''
EXAMPLES = '''
# file must be named openstack.yaml or openstack.yml # file must be named openstack.yaml or openstack.yml
# Make the plugin behave like the default behavior of the old script # Make the plugin behave like the default behavior of the old script
simple_config_file: simple_config_file:
@ -93,8 +97,6 @@ simple_config_file:
expand_hostvars: true expand_hostvars: true
fail_on_errors: true fail_on_errors: true
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import collections import collections

@ -2,8 +2,10 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
inventory: script inventory: script
version_added: "2.4" version_added: "2.4"
short_description: Executes an inventory script that returns JSON short_description: Executes an inventory script that returns JSON
@ -15,8 +17,6 @@ DOCUMENTATION:
- It takes the place of the previously hardcoded script inventory. - It takes the place of the previously hardcoded script inventory.
- To function it requires being whitelisted in configuration, which is true by default. - To function it requires being whitelisted in configuration, which is true by default.
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
import subprocess import subprocess

@ -1,8 +1,10 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
name: virtualbox name: virtualbox
plugin_type: inventory plugin_type: inventory
short_description: virtualbox inventory source short_description: virtualbox inventory source
@ -32,7 +34,9 @@ DOCUMENTATION:
description: add hosts to group based on Jinja2 conditionals, these also run after query block description: add hosts to group based on Jinja2 conditionals, these also run after query block
type: dictionary type: dictionary
default: {} default: {}
EXAMPLES: '''
EXAMPLES = '''
# file must be named vbox.yaml or vbox.yml # file must be named vbox.yaml or vbox.yml
simple_config_file: simple_config_file:
plugin: virtualbox plugin: virtualbox
@ -42,8 +46,6 @@ simple_config_file:
compose: compose:
ansible_connection: ('indows' in vbox_Guest_OS)|ternary('winrm', 'ssh') ansible_connection: ('indows' in vbox_Guest_OS)|ternary('winrm', 'ssh')
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os

@ -1,8 +1,10 @@
# Copyright (c) 2017 Ansible Project # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
inventory: yaml inventory: yaml
version_added: "2.4" version_added: "2.4"
short_description: Uses a specifically YAML file as inventory source. short_description: Uses a specifically YAML file as inventory source.
@ -20,7 +22,8 @@ DOCUMENTATION:
description: list of 'valid' extensions for files containing YAML description: list of 'valid' extensions for files containing YAML
type: list type: list
default: ['.yaml', '.yml', '.json'] default: ['.yaml', '.yml', '.json']
EXAMPLES: '''
EXAMPLES = '''
all: # keys must be unique, i.e. only one 'hosts' per group all: # keys must be unique, i.e. only one 'hosts' per group
hosts: hosts:
test1: test1:
@ -46,9 +49,6 @@ all: # keys must be unique, i.e. only one 'hosts' per group
last_var: MYVALUE last_var: MYVALUE
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re import re
import os import os

@ -14,8 +14,10 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
""" from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = """
lookup: cartesian lookup: cartesian
version_added: "2.1" version_added: "2.1"
short_description: returns the cartesian product of lists short_description: returns the cartesian product of lists
@ -26,7 +28,9 @@ DOCUMENTATION:
description: description:
- a set of lists - a set of lists
required: True required: True
EXAMPLES: """
EXAMPLES = """
- name: outputs the cartesian product of the supplied lists - name: outputs the cartesian product of the supplied lists
debug: msg="{{item}}" debug: msg="{{item}}"
@ -35,15 +39,14 @@ EXAMPLES:
- "{{list2}}" - "{{list2}}"
- name: used as lookup changes [1, 2, 3], [a, b] into [1, a], [1, b], [2, a], [2, b], [3, a], [3, b] - name: used as lookup changes [1, 2, 3], [a, b] into [1, a], [1, b], [2, a], [2, b], [3, a], [3, b]
debug: msg="{{ [1,2,3]|lookup('cartesian', [a, b])}}" debug: msg="{{ [1,2,3]|lookup('cartesian', [a, b])}}"
"""
RETURN: RETURN = """
_list: _list:
description: description:
- list of lists composed of elements of the input lists - list of lists composed of elements of the input lists
type: lists type: lists
""" """
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from itertools import product from itertools import product

@ -15,8 +15,10 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
author: author:
- Jan-Piet Mens (@jpmens) - Jan-Piet Mens (@jpmens)
lookup: etcd lookup: etcd
@ -47,21 +49,23 @@ DOCUMENTATION:
- name: ANSIBLE_ETCD_VERSION - name: ANSIBLE_ETCD_VERSION
yaml: yaml:
- key: etcd.version - key: etcd.version
EXAMPLES: '''
EXAMPLES = '''
- name: "a value from a locally running etcd" - name: "a value from a locally running etcd"
debug: msg={{ lookup('etcd', 'foo/bar') }} debug: msg={{ lookup('etcd', 'foo/bar') }}
- name: "a values from a folder on a locally running etcd" - name: "a values from a folder on a locally running etcd"
debug: msg={{ lookup('etcd', 'foo') }} debug: msg={{ lookup('etcd', 'foo') }}
RETURN: '''
RETURN = '''
_raw: _raw:
description: description:
- list of values associated with input keys - list of values associated with input keys
type: list type: list
elements: strings elements: strings
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os

@ -15,8 +15,12 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
'''
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
from ansible.module_utils.six import string_types, integer_types
__metaclass__ = type
DOCUMENTATION = '''
author: 'Marcos Diez <marcos (at) unitron.com.br>' author: 'Marcos Diez <marcos (at) unitron.com.br>'
lookup: mongodb lookup: mongodb
version_added: "2.3" version_added: "2.3"
@ -65,7 +69,9 @@ DOCUMENTATION:
- "Please check https://api.mongodb.org/python/current/api/pymongo/collection.html?highlight=find#pymongo.collection.Collection.find for more detais." - "Please check https://api.mongodb.org/python/current/api/pymongo/collection.html?highlight=find#pymongo.collection.Collection.find for more detais."
requirements: requirements:
- pymongo >= 2.4 - pymongo >= 2.4
EXAMPLES: '''
EXAMPLES = '''
- hosts: all - hosts: all
gather_facts: false gather_facts: false
vars: vars:
@ -87,12 +93,8 @@ EXAMPLES:
with_mongodb: "{{mongodb_parameters}}" with_mongodb: "{{mongodb_parameters}}"
''' '''
from __future__ import (absolute_import, division, print_function)
from ansible.module_utils.six import string_types, integer_types
import datetime import datetime
__metaclass__ = type
try: try:
from pymongo import ASCENDING, DESCENDING from pymongo import ASCENDING, DESCENDING
from pymongo.errors import ConnectionFailure from pymongo.errors import ConnectionFailure

@ -12,8 +12,10 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
strategy: debug strategy: debug
short_description: Executes tasks in interactive debug session. short_description: Executes tasks in interactive debug session.
description: description:
@ -22,9 +24,6 @@ DOCUMENTATION:
author: Kishin Yagami author: Kishin Yagami
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import cmd import cmd
import pprint import pprint
import sys import sys

@ -14,8 +14,11 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
strategy: free strategy: free
short_description: Executes tasks on each host independently short_description: Executes tasks on each host independently
description: description:
@ -25,9 +28,6 @@ DOCUMENTATION:
version_added: "2.0" version_added: "2.0"
author: Ansible Core Team author: Ansible Core Team
''' '''
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import time import time

@ -14,8 +14,11 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
''' # Make coding more python3-ish
DOCUMENTATION: from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
strategy: linear strategy: linear
short_description: Executes tasks in a linear fashion short_description: Executes tasks in a linear fashion
description: description:
@ -27,9 +30,6 @@ DOCUMENTATION:
- This was the default Ansible behaviour before 'strategy plugins' were introduced in 2.0. - This was the default Ansible behaviour before 'strategy plugins' were introduced in 2.0.
author: Ansible Core Team author: Ansible Core Team
''' '''
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleError from ansible.errors import AnsibleError
from ansible.executor.play_iterator import PlayIterator from ansible.executor.play_iterator import PlayIterator

@ -15,8 +15,10 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
############################################# #############################################
''' from __future__ import (absolute_import, division, print_function)
DOCUMENTATION: __metaclass__ = type
DOCUMENTATION = '''
vars: host_group_vars vars: host_group_vars
version_added: "2.4" version_added: "2.4"
short_description: In charge of loading group_vars and host_vars short_description: In charge of loading group_vars and host_vars
@ -41,9 +43,6 @@ DOCUMENTATION:
type: list type: list
''' '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os import os
from ansible import constants as C from ansible import constants as C
from ansible.errors import AnsibleParserError from ansible.errors import AnsibleParserError

Loading…
Cancel
Save