| 1 |
{%- set heading = ['-', '+', '#', '*', '^', '"', "'"] -%} |
| 2 |
{% macro render_action(parent, action, action_docs) %} |
| 3 |
|
| 4 |
.. program:: {{cli_name}} {{parent + action}} |
| 5 |
.. _{{cli_name|replace('-','_')}}_{{parent|replace(' ','_')}}{{action}}: |
| 6 |
|
| 7 |
{{ parent + action }} |
| 8 |
{{ heading[parent.count(' ')] * (parent + action)|length }} |
| 9 |
|
| 10 |
{{ (action_docs['desc']|default(' ')) }} |
| 11 |
|
| 12 |
{% if action_docs['options'] %} |
| 13 |
|
| 14 |
|
| 15 |
{% for option in action_docs['options']|sort(attribute='options') %} |
| 16 |
.. option:: {% for switch in option['options'] if switch in action_docs['option_names'] %}{{switch}} {% if option['arg'] %} <{{option['arg']}}>{% endif %}{% if not loop.last %}, {% endif %}{% endfor %} |
| 17 |
|
| 18 |
{{ (option['desc']) }} |
| 19 |
{% endfor %} |
| 20 |
{% endif %} |
| 21 |
{%- set nested_actions = action_docs['actions'] -%} |
| 22 |
{% if nested_actions %} |
| 23 |
|
| 24 |
{% for nested_action in nested_actions %} |
| 25 |
{{ render_action(parent + action + ' ', nested_action, nested_actions[nested_action]) }} |
| 26 |
|
| 27 |
{% endfor %} |
| 28 |
{%- endif %} |
| 29 |
{%- endmacro -%} |
| 30 |
:source: {{ source }} |
| 31 |
|
| 32 |
{% set name = cli_name -%} |
| 33 |
{% set name_slug = cli_name -%} |
| 34 |
|
| 35 |
.. _{{name}}: |
| 36 |
|
| 37 |
{% set name_len = name|length + 0-%} |
| 38 |
{{ '=' * name_len }} |
| 39 |
{{name}} |
| 40 |
{{ '=' * name_len }} |
| 41 |
|
| 42 |
|
| 43 |
:strong:`{{short_desc|default('')}}` |
| 44 |
|
| 45 |
|
| 46 |
.. contents:: |
| 47 |
:local: |
| 48 |
:depth: {{content_depth}} |
| 49 |
|
| 50 |
|
| 51 |
.. program:: {{cli_name}} |
| 52 |
|
| 53 |
Synopsis |
| 54 |
======== |
| 55 |
|
| 56 |
.. code-block:: bash |
| 57 |
|
| 58 |
{{ usage|replace('%prog', cli_name) }} |
| 59 |
|
| 60 |
|
| 61 |
Description |
| 62 |
=========== |
| 63 |
|
| 64 |
|
| 65 |
{{ long_desc|default('', True) }} |
| 66 |
|
| 67 |
{% if options %} |
| 68 |
Common Options |
| 69 |
============== |
| 70 |
|
| 71 |
|
| 72 |
{% for option in options|sort(attribute='options') if option.options %} |
| 73 |
|
| 74 |
.. option:: {% for switch in option['options'] %}{{switch}}{% if option['arg'] %} <{{option['arg']}}>{% endif %}{% if not loop.last %}, {% endif %}{% endfor %} |
| 75 |
|
| 76 |
{{ option['desc'] }} |
| 77 |
{% endfor %} |
| 78 |
{% endif %} |
| 79 |
|
| 80 |
{% if arguments %} |
| 81 |
ARGUMENTS |
| 82 |
========= |
| 83 |
|
| 84 |
.. program:: {{cli_name}} |
| 85 |
|
| 86 |
{% for arg in arguments %} |
| 87 |
.. option:: {{ arg }} |
| 88 |
|
| 89 |
{{ (arguments[arg]|default(' '))}} |
| 90 |
|
| 91 |
{% endfor %} |
| 92 |
{% endif %} |
| 93 |
|
| 94 |
{% if actions %} |
| 95 |
Actions |
| 96 |
======= |
| 97 |
|
| 98 |
{% for action in actions %} |
| 99 |
{{- render_action('', action, actions[action]) }} |
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
{% endfor %} |
| 104 |
.. program:: {{cli_name}} |
| 105 |
{% endif %} |
| 106 |
|
| 107 |
Environment |
| 108 |
=========== |
| 109 |
|
| 110 |
The following environment variables may be specified. |
| 111 |
|
| 112 |
{% if inventory %} |
| 113 |
:envvar:`ANSIBLE_INVENTORY` -- Override the default ansible inventory file |
| 114 |
|
| 115 |
{% endif %} |
| 116 |
{% if library %} |
| 117 |
:envvar:`ANSIBLE_LIBRARY` -- Override the default ansible module library path |
| 118 |
|
| 119 |
{% endif %} |
| 120 |
:envvar:`ANSIBLE_CONFIG` -- Override the default ansible config file |
| 121 |
|
| 122 |
Many more are available for most options in ansible.cfg |
| 123 |
|
| 124 |
|
| 125 |
Files |
| 126 |
===== |
| 127 |
|
| 128 |
{% if inventory %} |
| 129 |
:file:`/etc/ansible/hosts` -- Default inventory file |
| 130 |
|
| 131 |
{% endif %} |
| 132 |
:file:`/etc/ansible/ansible.cfg` -- Config file, used if present |
| 133 |
|
| 134 |
:file:`~/.ansible.cfg` -- User config file, overrides the default config if present |
| 135 |
|
| 136 |
Author |
| 137 |
====== |
| 138 |
|
| 139 |
Ansible was originally written by Michael DeHaan. |
| 140 |
|
| 141 |
See the `AUTHORS` file for a complete list of contributors. |
| 142 |
|
| 143 |
|
| 144 |
License |
| 145 |
======= |
| 146 |
|
| 147 |
Ansible is released under the terms of the GPLv3+ License. |
| 148 |
|
| 149 |
See also |
| 150 |
======== |
| 151 |
|
| 152 |
{% for other in cli_bin_name_list|sort %}{% if other != cli_name %}:manpage:`{{other}}(1)`{% if not loop.last %}, {% endif %}{% endif %}{% endfor %} |