Enable documentation in plugins

Made ansible-doc more plugin agnostic
We can have docs in lookup, callback, connectionm strategy, etc
Use first docstring and make pepizis happy
generalized module_docs to plugin_docs
documented cartesian, ssh, default, jsonfile, etc as examples
changed lack of docs to warning when listing
made smarter about bad docstrings
better blacklisting
added handling of options/config/envs/etc
move blacklist to find_plugins, only need once
This commit is contained in:
Brian Coca 2017-03-17 21:07:39 -04:00 committed by Brian Coca
parent d3115ae8f3
commit 7839f70e36
18 changed files with 583 additions and 268 deletions

View file

@ -14,6 +14,34 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
"""
DOCUMENTATION:
lookup: cartesian
version_added: "2.1"
short_description: returns the cartesian product of lists
description:
- Takes the input lists and returns a list that represents the product of the input lists.
options:
_raw:
description:
- a set of lists
required: True
EXAMPLES:
- name: outputs the cartesian product of the supplied lists
debug: msg="{{item}}"
with_cartesian:
- "{{list1}}"
- "{{list2}}"
- 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])}}"
RETURN:
_list:
description:
- list of lists composed of elements of the input lists
type: lists
"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type