You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Go to file
Matt Clay 63413cb0d4
[stable-2.14] Fix misrendered sections in manpage generation (#81380)
This change fixes bugs in the manpage generator that existed since it
was first added.

It exposes CLI `ARGUMENTS` value to manpage templates.

Before this change, the code contained a typo, causing the `for`-loop
iterate over individual characters of the `'ARGUMENTS'` string rather
than iterating over a tuple. A missing comma was at fault.

The updated code gets rid of the `for`-loop and conditionals since it
seems to have been a premature complexity increase and no other things
than `'ARGUMENTS'` were ever added into the broken iterable.

The functional change is that `arguments` is now always present in the
Jinja2 context, unlike being missing sometimes because of the previous
design (not that it was ever present, because of the bug! sigh...)

The Jinja2 templates perform an `{% if arguments %}` check, letting
the template engine silently ignore the missing variable. The clause
was always falsy, meaning that the arguments section was not included
in the manpages for at least the last 6 years. With this fix, it will
be.

This patch also deduplicates calling `opt_doc_list` @ generate_man.

It was called late in the execution, more times than necessary. This
patch makes sure it happens once by putting it at the top of the scope.

It fixes rendering library and inventory in manpages.

The corresponding Jinja2 templates have blocks wrapped with
conditionals like `{% if inventory %}` and `{% if library %}` but said
variables were never injected into the context, nor were they even
deduced on the Python side of the generator. This means that the
conditional clauses were always falsy, never showing the portions of
the manpages.

The Python script has hints for how the `inventory` variable was to be
calculated, which is confirmed through the Git paleontology efforts.

The block of code that references to the `inventory` bit was
incorrectly checking a variable with a list of nested objects for the
presence of a string which was never going to work.

This patch fixes this check by verifying the CLI flag against the
correct variable containing a list of options and exposes it to the
Jinja2 templates.
It also exposes the `library` variable in a similar way.

The block displaying other binaries in Sphinx CLI docs has been
synchronized with the manpage template.
Previously, the current binary was displayed also. This patch gets rid
of the unwanted trailing comma there too.

Finally, the CLI executables list in the manpage template now reuses
the same variable as the RST template that doesn't need any
post-processing in Jinja2.
Before, it was already used in the RST template so this patch aligns
both templates to use the same logic as they got out-of-sync over time.

PR #80450.
(cherry picked from commit a84b3a4e72)

Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
1 year ago
.azure-pipelines [stable-2.14] Reorganize CI sanity test matrix (#81004) (#81226) 1 year ago
.github [stable-2.14] define code owners to support branch-protection rules on docs (#81041) (#81044) 1 year ago
bin
changelogs [stable-2.14] Fix missing command descriptions in manpages/docs (#81366). (#81371) 1 year ago
docs [stable-2.14] Fix misrendered sections in manpage generation (#81380) 1 year ago
examples issue #72449 winrm script rm (#77931) 2 years ago
hacking [stable-2.14] Fix misrendered sections in manpage generation (#81380) 1 year ago
lib/ansible [stable-2.14] Fix missing command descriptions in manpages/docs (#81366). (#81371) 1 year ago
licenses Update PSF-license.txt to version from CPython 3.9.5. (#77805) 3 years ago
packaging [stable-2.14] Fix misrendered sections in manpage generation (#81380) 1 year ago
test [stable-2.14] ansible-test - update module_utils/urls.py unit test to support cryptography >= 41.0.0 (#81296) (#81317) 1 year ago
.cherry_picker.toml
.gitattributes
.gitignore Env gitignore (#78766) 2 years ago
.mailmap
COPYING
MANIFEST.in [stable-2.14] Convert non-docs *.rst files to *.md (#81217) (#81223) 1 year ago
Makefile [stable-2.14] Remove hacking dir dependency from build backend (#81026) 1 year ago
README.md [stable-2.14] Convert non-docs *.rst files to *.md (#81217) (#81223) 1 year ago
pyproject.toml [backport-2.14] 📦 Integrate manpage builds into PEP 517 build backend (#80129) 2 years ago
requirements.txt Pin PyYAML version compatible with Python 3.8+ (#77936) 3 years ago
setup.cfg [stable-2.14] Convert non-docs *.rst files to *.md (#81217) (#81223) 1 year ago
setup.py

README.md

PyPI version Docs badge Chat badge Build Status Ansible Code of Conduct Ansible mailing lists Repository License Ansible CII Best Practices certification

Ansible

Ansible is a radically simple IT automation system. It handles configuration management, application deployment, cloud provisioning, ad-hoc task execution, network automation, and multi-node orchestration. Ansible makes complex changes like zero-downtime rolling updates with load balancers easy. More information on the Ansible website.

Design Principles

  • Have an extremely simple setup process with a minimal learning curve.
  • Manage machines quickly and in parallel.
  • Avoid custom-agents and additional open ports, be agentless by leveraging the existing SSH daemon.
  • Describe infrastructure in a language that is both machine and human friendly.
  • Focus on security and easy auditability/review/rewriting of content.
  • Manage new remote machines instantly, without bootstrapping any software.
  • Allow module development in any dynamic language, not just Python.
  • Be usable as non-root.
  • Be the easiest IT automation system to use, ever.

Use Ansible

You can install a released version of Ansible with pip or a package manager. See our installation guide for details on installing Ansible on a variety of platforms.

Power users and developers can run the devel branch, which has the latest features and fixes, directly. Although it is reasonably stable, you are more likely to encounter breaking changes when running the devel branch. We recommend getting involved in the Ansible community if you want to run the devel branch.

Get Involved

  • Read Community Information for all kinds of ways to contribute to and interact with the project, including mailing list information and how to submit bug reports and code to Ansible.
  • Join a Working Group, an organized community devoted to a specific technology domain or platform.
  • Submit a proposed code update through a pull request to the devel branch.
  • Talk to us before making larger changes to avoid duplicate efforts. This not only helps everyone know what is going on, but it also helps save time and effort if we decide some changes are needed.
  • For a list of email lists, IRC channels and Working Groups, see the Communication page

Coding Guidelines

We document our Coding Guidelines in the Developer Guide. We particularly suggest you review:

Branch Info

  • The devel branch corresponds to the release actively under development.
  • The stable-2.X branches correspond to stable releases.
  • Create a branch based on devel and set up a dev environment if you want to open a PR.
  • See the Ansible release and maintenance page for information about active branches.

Roadmap

Based on team and community feedback, an initial roadmap will be published for a major or minor version (ex: 2.7, 2.8). The Ansible Roadmap page details what is planned and how to influence the roadmap.

Authors

Ansible was created by Michael DeHaan and has contributions from over 5000 users (and growing). Thanks everyone!

Ansible is sponsored by Red Hat, Inc.

License

GNU General Public License v3.0 or later

See COPYING to see the full text.