diff options
author | Matt Clay <matt@mystile.com> | 2023-06-08 21:41:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-08 21:41:45 +0200 |
commit | b3f1290bcdc28a4b5d6d859ff4346ea0784c3ca1 (patch) | |
tree | c70d0704c6b90afbb72c615e04ab151d6782b6fe /hacking | |
parent | Roadmap: Update 8.1.0 ETA (#80998) (diff) | |
download | ansible-b3f1290bcdc28a4b5d6d859ff4346ea0784c3ca1.tar.xz ansible-b3f1290bcdc28a4b5d6d859ff4346ea0784c3ca1.zip |
Remove docs dir dependency from man page build (#81003)
Diffstat (limited to 'hacking')
-rw-r--r-- | hacking/build_library/build_ansible/command_plugins/generate_man.py | 2 | ||||
-rw-r--r-- | hacking/templates/man.j2 | 127 |
2 files changed, 128 insertions, 1 deletions
diff --git a/hacking/build_library/build_ansible/command_plugins/generate_man.py b/hacking/build_library/build_ansible/command_plugins/generate_man.py index 2d8d1b0ec4..4228c48b4d 100644 --- a/hacking/build_library/build_ansible/command_plugins/generate_man.py +++ b/hacking/build_library/build_ansible/command_plugins/generate_man.py @@ -21,7 +21,7 @@ from ..change_detection import update_file_if_different # pylint: disable=relat from ..commands import Command # pylint: disable=relative-beyond-top-level -DEFAULT_TEMPLATE_FILE = pathlib.Path(__file__).parents[4] / 'docs/templates/man.j2' +DEFAULT_TEMPLATE_FILE = pathlib.Path(__file__).parents[4] / 'hacking/templates/man.j2' # from https://www.python.org/dev/peps/pep-0257/ diff --git a/hacking/templates/man.j2 b/hacking/templates/man.j2 new file mode 100644 index 0000000000..9a8cb1d793 --- /dev/null +++ b/hacking/templates/man.j2 @@ -0,0 +1,127 @@ +{{ cli_name }} +{{ '=' * ( cli_name|length|int ) }} + +{{ '-' * ( short_desc|default('')|string|length|int ) }} +{{short_desc|default('')}} +{{ '-' * ( short_desc|default('')|string|length|int ) }} + +:Version: Ansible %VERSION% +:Manual section: 1 +:Manual group: System administration commands + + + +SYNOPSIS +-------- +{{ usage|replace('%prog', cli_name) }} + + +DESCRIPTION +----------- +{{ long_desc|default('', True)|wordwrap }} + +{% if options %} +COMMON OPTIONS +-------------- +{% for option in options|sort(attribute='options') %} +{% for switch in option['options'] %}**{{switch}}**{% if option['arg'] %} '{{option['arg']}}'{% endif %}{% if not loop.last %}, {% endif %}{% endfor %} + + {{ option['desc'] }} +{% endfor %} +{% endif %} + +{% if arguments %} +ARGUMENTS +--------- + +{% for arg in arguments %} +{{ arg }} + +{{ (arguments[arg]|default(' '))|wordwrap }} + +{% endfor %} +{% endif %} + +{% if actions %} +ACTIONS +------- +{% for action in actions %} +**{{ action }}** + {{ (actions[action]['desc']|default(' ')) |replace('\n', ' ')}} + +{% if actions[action]['options'] %} +{% for option in actions[action]['options']|sort(attribute='options') %} +{% for switch in option['options'] if switch in actions[action]['option_names'] %} **{{switch}}**{% if option['arg'] %} '{{option['arg']}}'{% endif %}{% if not loop.last %}, {% endif %}{% endfor %} + + {{ (option['desc']) }} +{% endfor %} +{% endif %} +{% endfor %} +{% endif %} + + +{% if inventory %} +INVENTORY +--------- + +Ansible stores the hosts it can potentially operate on in an inventory. +This can be an YAML file, ini-like file, a script, directory, list, etc. +For additional options, see the documentation on https://docs.ansible.com/. + +{% endif %} +ENVIRONMENT +----------- + +The following environment variables may be specified. + +{% if inventory %} +ANSIBLE_INVENTORY -- Override the default ansible inventory sources + +{% endif %} +{% if library %} +ANSIBLE_LIBRARY -- Override the default ansible module library path + +{% endif %} +ANSIBLE_CONFIG -- Specify override location for the ansible config file + +Many more are available for most options in ansible.cfg + +For a full list check https://docs.ansible.com/. or use the `ansible-config` command. + +FILES +----- + +{% if inventory %} +/etc/ansible/hosts -- Default inventory file + +{% endif %} +/etc/ansible/ansible.cfg -- Config file, used if present + +~/.ansible.cfg -- User config file, overrides the default config if present + +./ansible.cfg -- Local config file (in current working directory) assumed to be 'project specific' and overrides the rest if present. + +As mentioned above, the ANSIBLE_CONFIG environment variable will override all others. + +AUTHOR +------ + +Ansible was originally written by Michael DeHaan. + + +COPYRIGHT +--------- + +Copyright © 2018 Red Hat, Inc | Ansible. +Ansible is released under the terms of the GPLv3 license. + + +SEE ALSO +-------- + +{% for other in cli_bin_name_list|sort %}{% if other != cli_name %}**{{ other }}** (1){% if not loop.last %}, {% endif %}{% endif %}{% endfor %} + +Extensive documentation is available in the documentation site: +<https://docs.ansible.com>. +IRC and mailing list info can be found in file CONTRIBUTING.md, +available in: <https://github.com/ansible/ansible> |