2018-02-24 03:57:37 +01:00
:source: @{ source }@
2018-04-23 15:22:44 +02:00
{# avoids rST "isn't included in any toctree" errors for module docs #}
{% if plugin_type == 'module' %}
:orphan:
{% endif %}
2018-04-18 03:45:07 +02:00
.. _@{ module }@_@{ plugin_type }@:
2018-03-15 18:29:03 +01:00
{% for alias in aliases %}
2018-05-30 09:26:25 +02:00
.. _@{ alias }@_@{ plugin_type }@:
2018-03-15 18:29:03 +01:00
{% endfor %}
2012-09-26 20:41:44 +02:00
2013-12-26 00:06:55 +01:00
{% if short_description %}
2018-12-20 18:34:32 +01:00
{% set title = module + ' -- ' + short_description | rst_ify %}
2013-12-26 00:06:55 +01:00
{% else %}
2018-02-25 16:40:27 +01:00
{% set title = module %}
2013-12-26 00:06:55 +01:00
{% endif %}
@{ title }@
2018-02-25 16:40:27 +01:00
@{ '+' * title|length }@
2013-12-26 00:06:55 +01:00
2017-09-19 17:14:27 +02:00
{% if version_added is defined and version_added != '' -%}
.. versionadded:: @{ version_added | default('') }@
2015-07-17 16:00:02 +02:00
{% endif %}
2013-12-25 20:05:43 +01:00
.. contents::
:local:
2018-12-20 18:34:32 +01:00
:depth: 1
2012-09-26 20:41:44 +02:00
{# ------------------------------------------
#
# Please note: this looks like a core dump
# but it isn't one.
#
--------------------------------------------#}
2014-10-30 18:29:54 +01:00
{% if deprecated is defined -%}
2017-09-19 17:14:27 +02:00
2014-10-30 18:29:54 +01:00
DEPRECATED
----------
2017-09-19 17:14:27 +02:00
{# use unknown here? skip the fields? #}
2018-12-12 21:19:58 +01:00
:Removed in Ansible: version: @{ deprecated['removed_in'] | default('') | string | rst_ify }@
:Why: @{ deprecated['why'] | default('') | rst_ify }@
:Alternative: @{ deprecated['alternative'] | default('') | rst_ify }@
2017-09-19 17:14:27 +02:00
2014-10-30 18:29:54 +01:00
{% endif %}
2013-12-25 20:05:43 +01:00
Synopsis
--------
2018-03-06 11:46:19 +01:00
{% if description -%}
2017-09-19 17:14:27 +02:00
2018-02-25 16:40:27 +01:00
{% if description is string -%}
2018-12-12 21:19:58 +01:00
- @{ description | rst_ify }@
2018-02-25 16:40:27 +01:00
{% else %}
2018-03-06 11:46:19 +01:00
{% for desc in description %}
2018-12-12 21:19:58 +01:00
- @{ desc | rst_ify }@
2018-02-25 16:40:27 +01:00
{% endfor %}
{% endif %}
2017-09-19 17:14:27 +02:00
{% endif %}
2017-11-09 18:45:11 +01:00
2015-07-17 16:00:02 +02:00
{% if aliases is defined -%}
Aliases: @{ ','.join(aliases) }@
2017-09-19 17:14:27 +02:00
{% endif %}
2015-06-04 04:19:26 +02:00
2018-03-06 11:46:19 +01:00
{% if requirements -%}
Requirements
2018-12-20 18:34:32 +01:00
------------
2018-02-25 16:40:27 +01:00
{% if plugin_type == 'module' %}
2018-03-06 11:46:19 +01:00
The below requirements are needed on the host that executes this @{ plugin_type }@.
{% else %}
The below requirements are needed on the local master node that executes this @{ plugin_type }@.
2018-02-25 16:40:27 +01:00
{% endif %}
2017-10-11 06:15:25 +02:00
2018-02-25 16:40:27 +01:00
{% for req in requirements %}
2018-12-12 21:19:58 +01:00
- @{ req | rst_ify }@
2018-02-25 16:40:27 +01:00
{% endfor %}
2017-09-19 17:14:27 +02:00
2015-06-04 04:19:26 +02:00
{% endif %}
2012-09-30 13:20:24 +02:00
{% if options -%}
2017-09-19 17:14:27 +02:00
2018-03-08 19:48:15 +01:00
Parameters
----------
2013-12-25 20:05:43 +01:00
2012-09-28 03:06:31 +02:00
.. raw:: html
2017-11-22 22:53:53 +01:00
<table border=0 cellpadding=0 class="documentation-table">
2018-06-25 20:27:15 +02:00
{# Pre-compute the nesting depth to allocate columns -#}
@{ to_kludge_ns('maxdepth', 1) -}@
{% for key, value in options|dictsort recursive -%}
@{ to_kludge_ns('maxdepth', [loop.depth, from_kludge_ns('maxdepth')] | max) -}@
{% if value.suboptions -%}
{% if value.suboptions.items -%}
@{ loop(value.suboptions.items()) -}@
{% elif value.suboptions[0].items -%}
@{ loop(value.suboptions[0].items()) -}@
{% endif -%}
{% endif -%}
{% endfor -%}
{# Header of the documentation -#}
2017-08-18 21:38:55 +02:00
<tr>
2018-06-25 20:27:15 +02:00
<th colspan="@{ from_kludge_ns('maxdepth') }@">Parameter</th>
2018-05-31 19:58:33 +02:00
<th>Choices/<font color="blue">Defaults</font></th>
2017-11-22 22:53:53 +01:00
{% if plugin_type != 'module' %}
2018-05-31 19:58:33 +02:00
<th>Configuration</th>
2017-11-22 22:53:53 +01:00
{% endif %}
2018-05-31 19:58:33 +02:00
<th width="100%">Comments</th>
2017-08-18 21:38:55 +02:00
</tr>
2018-01-24 23:50:05 +01:00
{% for key, value in options|dictsort recursive %}
2018-05-31 19:58:33 +02:00
<tr>
{# indentation based on nesting level #}
{% for i in range(1, loop.depth) %}
<td class="elbow-placeholder"></td>
{% endfor %}
2018-03-08 19:48:15 +01:00
{# parameter name with required and/or introduced label #}
2018-06-25 20:27:15 +02:00
<td colspan="@{ from_kludge_ns('maxdepth') - loop.depth0 }@">
2018-05-31 19:58:33 +02:00
<b>@{ key }@</b>
2018-12-20 18:34:32 +01:00
<div style="font-size: small">
<span style="color: purple">@{ value.type | documented_type }@</span>
{% if value.get('required', False) %} / <span style="color: red">required</span>{% endif %}
</div>
{% if value.version_added %}<div style="font-style: italic; font-size: small; color: darkgreen">added in @{value.version_added}@</div>{% endif %}
2017-11-22 22:53:53 +01:00
</td>
2018-03-08 19:48:15 +01:00
{# default / choices #}
2017-11-22 22:53:53 +01:00
<td>
2018-05-31 19:58:33 +02:00
{# Turn boolean values in 'yes' and 'no' values #}
{% if value.default is sameas true %}
{% set _x = value.update({'default': 'yes'}) %}
{% elif value.default is sameas false %}
{% set _x = value.update({'default': 'no'}) %}
{% endif %}
{% if value.type == 'bool' %}
{% set _x = value.update({'choices': ['no', 'yes']}) %}
{% endif %}
{# Show possible choices and highlight details #}
{% if value.choices %}
2018-12-20 18:34:32 +01:00
<ul style="margin: 0; padding: 0"><b>Choices:</b>
2018-05-31 19:58:33 +02:00
{% for choice in value.choices %}
{# Turn boolean values in 'yes' and 'no' values #}
{% if choice is sameas true %}
{% set choice = 'yes' %}
{% elif choice is sameas false %}
{% set choice = 'no' %}
{% endif %}
2018-06-28 04:31:47 +02:00
{% if (value.default is not list and value.default == choice) or (value.default is list and choice in value.default) %}
2018-05-31 19:58:33 +02:00
<li><div style="color: blue"><b>@{ choice | escape }@</b> ←</div></li>
{% else %}
<li>@{ choice | escape }@</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{# Show default value, when multiple choice or no choices #}
{% if value.default is defined and value.default not in value.choices %}
<b>Default:</b><br/><div style="color: blue">@{ value.default | escape }@</div>
{% endif %}
2017-11-22 22:53:53 +01:00
</td>
{# configuration #}
{% if plugin_type != 'module' %}
<td>
2018-05-31 19:58:33 +02:00
{% if 'ini' in value %}
<div> ini entries:
{% for ini in value.ini %}
2018-10-04 02:47:31 +02:00
<p>[@{ ini.section }@]<br>@{ ini.key }@ = @{ value.default | default('VALUE') }@</p>
2017-11-22 22:53:53 +01:00
{% endfor %}
2018-05-31 19:58:33 +02:00
</div>
{% endif %}
{% if 'env' in value %}
{% for env in value.env %}
<div>env:@{ env.name }@</div>
{% endfor %}
{% endif %}
{% if 'vars' in value %}
{% for myvar in value.vars %}
<div>var: @{ myvar.name }@</div>
{% endfor %}
{% endif %}
2017-11-22 22:53:53 +01:00
</td>
{% endif %}
{# description #}
<td>
2018-05-31 19:58:33 +02:00
{% if value.description is string %}
<div>@{ value.description | replace('\n', '\n ') | html_ify }@</div>
{% else %}
{% for desc in value.description %}
<div>@{ desc | replace('\n', '\n ') | html_ify }@</div>
{% endfor %}
{% endif %}
{% if 'aliases' in value and value.aliases %}
<div style="font-size: small; color: darkgreen"><br/>aliases: @{ value.aliases|join(', ') }@</div>
{% endif %}
2017-11-22 22:53:53 +01:00
</td>
</tr>
{% if value.suboptions %}
{% if value.suboptions.items %}
@{ loop(value.suboptions.items()) }@
{% elif value.suboptions[0].items %}
@{ loop(value.suboptions[0].items()) }@
{% endif %}
{% endif %}
{% endfor %}
2012-09-28 03:06:31 +02:00
</table>
2018-03-08 19:48:15 +01:00
<br/>
2015-06-04 04:19:26 +02:00
2018-02-28 17:58:49 +01:00
{% endif %}
2018-03-06 11:46:19 +01:00
{% if notes -%}
2018-02-28 17:58:49 +01:00
Notes
-----
.. note::
{% for note in notes %}
2018-12-12 21:19:58 +01:00
- @{ note | rst_ify }@
2018-02-28 17:58:49 +01:00
{% endfor %}
2012-09-26 20:41:44 +02:00
{% endif %}
2018-12-12 21:19:58 +01:00
{% if seealso -%}
See Also
--------
.. seealso::
{% for item in seealso %}
{% if item.module is defined and item.description is defined %}
2018-12-17 17:20:06 +01:00
:ref:`@{ item.module }@_module`
2018-12-12 21:19:58 +01:00
@{ item.description | rst_ify }@
{% elif item.module is defined %}
:ref:`@{ item.module }@_module`
The official documentation on the **@{ item.module }@** module.
{% elif item.name is defined and item.link is defined and item.description is defined %}
`@{ item.name }@ <@{ item.link }@>`_
@{ item.description | rst_ify }@
{% elif item.ref is defined and item.description is defined %}
:ref:`@{ item.ref }@`
@{ item.description | rst_ify }@
{% endif %}
{% endfor %}
{% endif %}
2018-03-06 11:46:19 +01:00
{% if examples or plainexamples -%}
2013-05-11 16:31:47 +02:00
2013-12-25 20:05:43 +01:00
Examples
--------
2018-06-07 23:12:09 +02:00
.. code-block:: yaml+jinja
2012-09-28 03:30:32 +02:00
2018-02-25 16:40:27 +01:00
{% for example in examples %}
{% if example['description'] %}@{ example['description'] | indent(4, True) }@{% endif %}
2012-12-11 17:33:26 +01:00
@{ example['code'] | escape | indent(4, True) }@
2018-02-25 16:40:27 +01:00
{% endfor %}
{% if plainexamples %}@{ plainexamples | indent(4, True) }@{% endif %}
2013-05-11 16:31:47 +02:00
2018-03-06 11:46:19 +01:00
{% endif %}
2015-03-13 16:43:02 +01:00
2018-03-06 11:46:19 +01:00
{% if not returnfacts and returndocs and returndocs.ansible_facts is defined %}
{% set returnfacts = returndocs.ansible_facts.contains %}
{% set _x = returndocs.pop('ansible_facts', None) %}
{% endif %}
2017-09-19 17:14:27 +02:00
2018-03-06 11:46:19 +01:00
{% if returnfacts -%}
2017-09-19 17:14:27 +02:00
2018-03-06 11:46:19 +01:00
Returned Facts
--------------
Facts returned by this module are added/updated in the ``hostvars`` host facts and can be referenced by name just like any other host fact. They do not need to be registered in order to use them.
2015-03-13 16:43:02 +01:00
.. raw:: html
2015-03-13 17:17:15 +01:00
2017-11-22 22:53:53 +01:00
<table border=0 cellpadding=0 class="documentation-table">
2018-05-31 19:58:33 +02:00
{# Pre-compute the nesting depth to allocate columns #}
2018-06-25 20:27:15 +02:00
@{ to_kludge_ns('maxdepth', 1) -}@
2018-05-31 19:58:33 +02:00
{% for key, value in returnfacts|dictsort recursive %}
2018-06-25 20:27:15 +02:00
@{ to_kludge_ns('maxdepth', [loop.depth, from_kludge_ns('maxdepth')] | max) -}@
{% if value.contains -%}
{% if value.contains.items -%}
@{ loop(value.contains.items()) -}@
{% elif value.contains[0].items -%}
@{ loop(value.contains[0].items()) -}@
{% endif -%}
{% endif -%}
{% endfor -%}
2015-03-20 21:54:22 +01:00
<tr>
2018-06-25 20:27:15 +02:00
<th colspan="@{ from_kludge_ns('maxdepth') }@">Fact</th>
2018-05-31 19:58:33 +02:00
<th>Returned</th>
<th width="100%">Description</th>
2015-03-20 21:54:22 +01:00
</tr>
2018-03-06 11:46:19 +01:00
{% for key, value in returnfacts|dictsort recursive %}
2018-05-31 19:58:33 +02:00
<tr>
{% for i in range(1, loop.depth) %}
<td class="elbow-placeholder"></td>
{% endfor %}
2018-06-25 20:27:15 +02:00
<td colspan="@{ from_kludge_ns('maxdepth') - loop.depth0 }@" colspan="@{ from_kludge_ns('maxdepth') - loop.depth0 }@">
2018-05-31 19:58:33 +02:00
<b>@{ key }@</b>
2018-12-20 18:34:32 +01:00
<div style="font-size: small; color: purple">@{ value.type | documented_type }@</div>
{% if value.version_added %}<div style="font-style: italic; font-size: small; color: darkgreen">added in @{value.version_added}@</div>{% endif %}
2017-11-22 22:53:53 +01:00
</td>
2018-05-31 19:58:33 +02:00
<td>@{ value.returned | html_ify }@</td>
2017-11-22 22:53:53 +01:00
<td>
2018-05-31 19:58:33 +02:00
{% if value.description is string %}
<div>@{ value.description | html_ify }@
</div>
{% else %}
{% for desc in value.description %}
<div>@{ desc | html_ify }@
2018-04-18 22:04:47 +02:00
</div>
2018-05-31 19:58:33 +02:00
{% endfor %}
{% endif %}
<br/>
{% if value.sample is defined and value.sample %}
<div style="font-size: smaller"><b>Sample:</b></div>
{# TODO: The sample should be escaped, using | escape or | htmlify, but both mess things up beyond repair with dicts #}
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">@{ value.sample | replace('\n', '\n ') | html_ify }@</div>
{% endif %}
2017-11-22 22:53:53 +01:00
</td>
</tr>
{# ---------------------------------------------------------
# sadly we cannot blindly iterate through the child dicts,
# since in some documentations,
# lists are used instead of dicts. This handles both types
# ---------------------------------------------------------#}
{% if value.contains %}
{% if value.contains.items %}
@{ loop(value.contains.items()) }@
{% elif value.contains[0].items %}
@{ loop(value.contains[0].items()) }@
{% endif %}
{% endif %}
{% endfor %}
2015-03-20 21:54:22 +01:00
</table>
2018-03-06 11:46:19 +01:00
<br/><br/>
2015-03-13 16:43:02 +01:00
2018-03-06 11:46:19 +01:00
{% endif %}
2017-09-19 17:14:27 +02:00
2018-03-06 11:46:19 +01:00
{% if returndocs -%}
2017-09-19 17:14:27 +02:00
2018-03-06 11:46:19 +01:00
Return Values
-------------
Common return values are documented :ref:`here <common_return_values>`, the following are the fields unique to this @{ plugin_type }@:
2017-09-19 17:14:27 +02:00
2018-03-06 11:46:19 +01:00
.. raw:: html
2012-09-28 03:30:32 +02:00
2018-03-06 11:46:19 +01:00
<table border=0 cellpadding=0 class="documentation-table">
2018-06-25 20:27:15 +02:00
@{ to_kludge_ns('maxdepth', 1) -}@
{% for key, value in returndocs|dictsort recursive -%}
@{ to_kludge_ns('maxdepth', [loop.depth, from_kludge_ns('maxdepth')] | max) -}@
{% if value.contains -%}
{% if value.contains.items -%}
@{ loop(value.contains.items()) -}@
{% elif value.contains[0].items -%}
@{ loop(value.contains[0].items()) -}@
{% endif -%}
{% endif -%}
{% endfor -%}
2018-03-06 11:46:19 +01:00
<tr>
2018-06-25 20:27:15 +02:00
<th colspan="@{ from_kludge_ns('maxdepth') }@">Key</th>
2018-05-31 19:58:33 +02:00
<th>Returned</th>
<th width="100%">Description</th>
2018-03-06 11:46:19 +01:00
</tr>
{% for key, value in returndocs|dictsort recursive %}
2018-05-31 19:58:33 +02:00
<tr>
{% for i in range(1, loop.depth) %}
<td class="elbow-placeholder"> </td>
{% endfor %}
2018-06-25 20:27:15 +02:00
<td colspan="@{ from_kludge_ns('maxdepth') - loop.depth0 }@">
2018-05-31 19:58:33 +02:00
<b>@{ key }@</b>
2018-12-20 18:34:32 +01:00
<div style="font-size: small; color: purple">@{ value.type | documented_type }@</div>
{% if value.version_added %}<div style="font-style: italic; font-size: small; color: darkgreen">added in @{value.version_added}@</div>{% endif %}
2018-03-06 11:46:19 +01:00
</td>
2018-05-31 19:58:33 +02:00
<td>@{ value.returned | html_ify }@</td>
2018-03-06 11:46:19 +01:00
<td>
2018-05-31 19:58:33 +02:00
{% if value.description is string %}
2018-06-21 13:51:58 +02:00
<div>@{ value.description | html_ify |indent(4) | trim}@</div>
2018-05-31 19:58:33 +02:00
{% else %}
{% for desc in value.description %}
2018-06-21 13:51:58 +02:00
<div>@{ desc | html_ify |indent(4) | trim}@</div>
2018-05-31 19:58:33 +02:00
{% endfor %}
{% endif %}
<br/>
{% if value.sample is defined and value.sample %}
<div style="font-size: smaller"><b>Sample:</b></div>
{# TODO: The sample should be escaped, using |escape or |htmlify, but both mess things up beyond repair with dicts #}
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">@{ value.sample | replace('\n', '\n ') | html_ify }@</div>
{% endif %}
2018-03-06 11:46:19 +01:00
</td>
</tr>
{# ---------------------------------------------------------
# sadly we cannot blindly iterate through the child dicts,
# since in some documentations,
# lists are used instead of dicts. This handles both types
# ---------------------------------------------------------#}
{% if value.contains %}
{% if value.contains.items %}
@{ loop(value.contains.items()) }@
{% elif value.contains[0].items %}
@{ loop(value.contains[0].items()) }@
{% endif %}
{% endif %}
{% endfor %}
</table>
<br/><br/>
2017-09-19 17:14:27 +02:00
{% endif %}
2018-03-06 11:46:19 +01:00
Status
------
2018-12-20 18:34:32 +01:00
{% if deprecated %}
- This @{ plugin_type }@ will be removed in version @{ deprecated['removed_in'] | default('') | string | rst_ify }@. *[deprecated]*
- For more information see `DEPRECATED`_.
{% else %}
2018-03-06 11:46:19 +01:00
2018-10-08 20:54:53 +02:00
{% set support = { 'core': 'the Ansible Core Team', 'network': 'the Ansible Network Team', 'certified': 'an Ansible Partner', 'community': 'the Ansible Community', 'curated': 'a Third Party'} %}
2018-12-20 18:34:32 +01:00
{% set module_states = { 'preview': 'not guaranteed to have a backwards compatible interface', 'stableinterface': 'guaranteed to have no backward incompatible interface changes going forward'} %}
2018-03-06 11:46:19 +01:00
2018-02-25 16:40:27 +01:00
{% if metadata %}
{% if metadata.status %}
2014-09-27 00:23:57 +02:00
2018-02-28 18:21:24 +01:00
{% for cur_state in metadata.status %}
2018-12-20 18:34:32 +01:00
- This @{ plugin_type }@ is @{ module_states[cur_state] }@. *[@{ cur_state }@]*
2018-02-28 18:21:24 +01:00
{% endfor %}
2017-09-19 17:14:27 +02:00
2018-02-25 16:40:27 +01:00
{% endif %}
2017-09-19 17:14:27 +02:00
2018-10-08 20:54:53 +02:00
{% if metadata.supported_by %}
{% set supported_by = support[metadata.supported_by] %}
2018-12-20 18:34:32 +01:00
- This @{ plugin_type }@ is :ref:`maintained by @{ supported_by }@ <modules_support>`. *[@{ metadata.supported_by }@]*
2018-10-08 20:54:53 +02:00
{% if metadata.supported_by in ('core', 'network') %}
2018-12-20 18:34:32 +01:00
Red Hat Support
~~~~~~~~~~~~~~~
2014-09-27 00:23:57 +02:00
2018-12-20 18:34:32 +01:00
More information about Red Hat's support of this @{ plugin_type }@ is available from this `Red Hat Knowledge Base article <https://access.redhat.com/articles/3166901>`_.
2018-10-08 20:54:53 +02:00
{% endif %}
2018-02-25 16:40:27 +01:00
{% endif %}
2018-07-05 17:40:17 +02:00
2018-02-25 16:40:27 +01:00
{% endif %}
2018-03-06 11:46:19 +01:00
{% endif %}
{% if author is defined -%}
2018-12-20 18:34:32 +01:00
Authors
~~~~~~~
2018-03-06 11:46:19 +01:00
{% for author_name in author %}
- @{ author_name }@
{% endfor %}
2016-12-22 18:26:28 +01:00
{% endif %}
2014-09-26 23:52:50 +02:00
2018-03-06 11:46:19 +01:00
.. hint::
2018-04-16 15:29:49 +02:00
{% if plugin_type == 'module' %}
2018-04-05 19:48:37 +02:00
If you notice any issues in this documentation you can `edit this document <https://github.com/ansible/ansible/edit/devel/lib/ansible/modules/@{ source }@?description=%3C!---%20Your%20description%20here%20--%3E%0A%0A%2Blabel:%20docsite_pr>`_ to improve it.
2018-04-16 15:29:49 +02:00
{% else %}
2018-04-20 12:31:17 +02:00
If you notice any issues in this documentation you can `edit this document <https://github.com/ansible/ansible/edit/devel/lib/ansible/plugins/@{ plugin_type }@/@{ source }@>`_ to improve it.
2018-04-16 15:29:49 +02:00
{% endif %}