Skip to content

Added docs Inventory Guide. #10239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 55 commits into from
Jul 12, 2025

Conversation

vbotka
Copy link
Contributor

@vbotka vbotka commented Jun 13, 2025

SUMMARY

Add Inventory (Plugin) Guide

Guides
* community.general Filter Guide
* community.general Inventory (Plugin) Guide
* community.general Test (Plugin) Guide
ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME

NA

ADDITIONAL INFORMATION

NA

@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Jun 13, 2025
@felixfontein felixfontein added the check-before-release PR will be looked at again shortly before release and merged if possible. label Jun 13, 2025
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR docs_only labels Jun 13, 2025
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I've added some first comments below.

@ansibullbot ansibullbot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI labels Jun 13, 2025
@russoz
Copy link
Collaborator

russoz commented Jun 15, 2025

I think @felixfontein 's line of thought makes sense, these guides should be put together as iocage guides, instead of using major categories for the types of the plugins. I am not going through the contents of the texts today, but I trust Felix's sharp eyes must have caught all (or most) of necessary adjustments. And if we pick something else later on we can always adjust later on.

@felixfontein
Copy link
Collaborator

I haven't checked all files in detail yet, I mainly skimmed over it and added comments for some things that seemed to happen more than once / I noticed on the first pass. I'll take a closer look later :)

@russoz
Copy link
Collaborator

russoz commented Jun 15, 2025

Okie, I'll do the same - but not today

@felixfontein felixfontein added the backport-11 Automatically create a backport for the stable-10 branch label Jun 16, 2025
Copy link
Collaborator

@russoz russoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple of comments

Comment on lines 16 to 26
.. code-block:: bash

shell> cat /zroot/iocage/jails/srv_1/root/etc/dhclient-exit-hooks
case "$reason" in
"BOUND"|"REBIND"|"REBOOT"|"RENEW")
echo $new_ip_address > /var/db/dhclient-hook.address.$interface
;;
esac
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other .rst files, to showcase the contents of yaml files, you created two code-blocks, one "console" with the cat command and the other one with the content. Here it is all in one block. I believe both ways to be OK, but whichever one you want to use, apply it consistently to all cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consistently apply whatever works. The single bash block works fine here. This is not the case with yaml.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely not a generic "Inventory Guide" but rather an "iocage inventory guide". I think it should be named accordingly. Maybe a new section should be opened, like "Technology Guide" or something similar - I don't think it fits well in any of the existing sections.

I've already told you:

This is up to you. I'm only interested in the "inventory iocage" guide. Feel free to place it wherever you'd like.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consistently apply whatever works. The single bash block works fine here. This is not the case with yaml.

But the two cases are actually just one case, which is showing content of a file with cat. I reckon they should be formatted the same way. IMHO the current disposition is not a good editorial choice.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely not a generic "Inventory Guide" but rather an "iocage inventory guide". I think it should be named accordingly. Maybe a new section should be opened, like "Technology Guide" or something similar - I don't think it fits well in any of the existing sections.

I've already told you:

This is up to you. I'm only interested in the "inventory iocage" guide. Feel free to place it wherever you'd like.

And as I wrote in that comment, the suggested placement is a bit off. That being said, the second half of that comment was intended to be an invitation to a discussion, to you, to @felixfontein and anyone else in the community who might want to chip in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed problematic pygments to console. I won't use ansible-output because the playbook outputs are YAML. Thank you.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, the ansible-output lexer is in https://github.com/ansible-community/ansible-pygments/blob/main/src/ansible_pygments/lexers.py#L44-L214. If someone wants to create a lexer for Ansible output with YAML, that's the place where it belongs to. Not sure how hard that would be though, since handling mixing YAML, regular Ansible output, and diff output isn't trivial...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... the second half of that comment was intended to be an invitation to a discussion

I created this PR. I don't need an invitation.

I did that out of politeness to you and to others, not out of your necessity.

That being said, please create a new section for your guide - I suggested "Technology Guide" but you may prefer something else. Just keep in mind, as mentioned before, that "Inventory Guide" is misleading because this is not about inventories in general, but rather about one single technology that happens to provide an inventory.

And please mark the command line as console and the output as bash for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... create a lexer for Ansible output with YAML

JSON is a subset of YAML.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but not the other way around :) The advantage of a JSON object or list is that it's clear when it's done (assuming it doesn't have syntax errors). For YAML that's definitely not the case, which makes an Ansible output parser for YAML output harder than for JSON output.

@ansibullbot ansibullbot added stale_ci CI is older than 7 days, rerun before merging and removed stale_ci CI is older than 7 days, rerun before merging labels Jun 22, 2025
Copy link
Collaborator

@russoz russoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional comments and responses.

Comment on lines 16 to 26
.. code-block:: bash

shell> cat /zroot/iocage/jails/srv_1/root/etc/dhclient-exit-hooks
case "$reason" in
"BOUND"|"REBIND"|"REBOOT"|"RENEW")
echo $new_ip_address > /var/db/dhclient-hook.address.$interface
;;
esac
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... the second half of that comment was intended to be an invitation to a discussion

I created this PR. I don't need an invitation.

I did that out of politeness to you and to others, not out of your necessity.

That being said, please create a new section for your guide - I suggested "Technology Guide" but you may prefer something else. Just keep in mind, as mentioned before, that "Inventory Guide" is misleading because this is not about inventories in general, but rather about one single technology that happens to provide an inventory.

And please mark the command line as console and the output as bash for consistency.

@vbotka
Copy link
Contributor Author

vbotka commented Jun 23, 2025

... mark the command line as console and the output as bash

I changed the pygment to sh. Quoting man dhclient-script:

... check for the existence of /etc/dhclient-exit-hooks. If found, it
will be sourced (see sh(1))

@vbotka
Copy link
Contributor Author

vbotka commented Jun 23, 2025

For the record:

The file inventory_guide.rst serves the purpose of inventory_guide_iocage.rst temporary integration. Please remove the BOTMETA entry after you decide where to place it

docs/docsite/rst/inventory_guide.rst: {}

Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't go through everything, but here's a bunch of more comments:

@vbotka
Copy link
Contributor Author

vbotka commented Jun 23, 2025

For the record:

docs/docsite/rst/inventory_guide_iocage_aliases.rst:117:0: (ERROR/3) Unknown interpreted text role "ansvalue".

@felixfontein
Copy link
Collaborator

Yep, sorry, it's :ansval:, not :ansvalue:...

@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Jul 2, 2025
@vbotka vbotka force-pushed the docs-guide-inventory branch from a6e0c00 to 1c91a91 Compare July 11, 2025 06:11
@ansibullbot ansibullbot removed the stale_ci CI is older than 7 days, rerun before merging label Jul 11, 2025
vbotka and others added 17 commits July 12, 2025 20:24
@vbotka vbotka force-pushed the docs-guide-inventory branch from 3b7c5d2 to 63bcde7 Compare July 12, 2025 18:25
@felixfontein felixfontein merged commit 563b29e into ansible-collections:main Jul 12, 2025
122 checks passed
Copy link

patchback bot commented Jul 12, 2025

Backport to stable-11: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-11/563b29e12ab774814ff5171a454f3ef5948e99c8/pr-10239

Backported as #10395

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein
Copy link
Collaborator

@vbotka thanks for your contribution!
@russoz thanks for reviewing!

patchback bot pushed a commit that referenced this pull request Jul 12, 2025
* Added docs Inventory Guide.

* Errata docs Inventory Guide.

* Fix docs Inventory Guide error: use ASCII quotes.

* Fix docs Inventory Guide various lint errors.

* Added docs Inventory Guide BOTMETA entries.

* Fix docs Inventory Guide lint errors: trailing whitespace

* Fix docs Inventory Guide lint errors: force yaml pygment

* Fix docs Inventory Guide lint errors: No way to force yaml pygment in code-block

* Update docs/docsite/rst/inventory_guide_iocage.rst

Co-authored-by: Felix Fontein <[email protected]>

* Update docs/docsite/rst/inventory_guide_iocage_aliases.rst

Thank you for the explanation!

Co-authored-by: Felix Fontein <[email protected]>

* Update docs/docsite/rst/inventory_guide_iocage_aliases.rst

Co-authored-by: Felix Fontein <[email protected]>

* Updated docs Inventory Guide.

* Problematic pygments changed to 'console'.

* Update docs/docsite/rst/inventory_guide_iocage_hooks.rst
  Update docs/docsite/rst/inventory_guide_iocage_properties.rst
  Update docs/docsite/rst/inventory_guide_iocage_hooks.rst

Co-authored-by: Alexei Znamensky <[email protected]>

* Put dhclient-exit-hooks into the sh code-block.

* Fix the code-block.

* Update docs/docsite/rst/inventory_guide_iocage.rst
  Update docs/docsite/rst/inventory_guide_iocage_aliases.rst
  Update docs/docsite/rst/inventory_guide_iocage_basics.rst

Co-authored-by: Felix Fontein <[email protected]>

* Remove tabs.

* Update docs/docsite/rst/inventory_guide_iocage_basics.rst

Co-authored-by: Felix Fontein <[email protected]>

* Indent the note block.

* Update docs/docsite/rst/inventory_guide_iocage_hooks.rst
  Update docs/docsite/rst/inventory_guide_iocage_dhcp.rst
  Update docs/docsite/rst/inventory_guide_iocage_hooks.rst

Co-authored-by: Felix Fontein <[email protected]>

* Fix ansval.

* Add guide_iocage.rst and inventory_guide_iocage*.rst

* Fix 'disallowed language sh found'.

* Remove note block.

* Remove include which triggers a bug in rstcheck.

* Update docs/docsite/extra-docs.yml
  Update docs/docsite/rst/iocage_inventory_guide_basics.rst
  Update docs/docsite/rst/iocage_inventory_guide_dhcp.rst
  Update docs/docsite/rst/iocage_inventory_guide_hooks.rst
  Update docs/docsite/rst/iocage_inventory_guide_properties.rst
  Update docs/docsite/rst/iocage_inventory_guide_tags.rst
  Update docs/docsite/rst/iocage_inventory_guide_hooks.rst
  Update docs/docsite/rst/iocage_inventory_guide_properties.rst

Co-authored-by: Felix Fontein <[email protected]>

* Put man iocage quotation into the text code block.

---------

Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Alexei Znamensky <[email protected]>
(cherry picked from commit 563b29e)
felixfontein added a commit that referenced this pull request Jul 12, 2025
…10395)

Added docs Inventory Guide. (#10239)

* Added docs Inventory Guide.

* Errata docs Inventory Guide.

* Fix docs Inventory Guide error: use ASCII quotes.

* Fix docs Inventory Guide various lint errors.

* Added docs Inventory Guide BOTMETA entries.

* Fix docs Inventory Guide lint errors: trailing whitespace

* Fix docs Inventory Guide lint errors: force yaml pygment

* Fix docs Inventory Guide lint errors: No way to force yaml pygment in code-block

* Update docs/docsite/rst/inventory_guide_iocage.rst



* Update docs/docsite/rst/inventory_guide_iocage_aliases.rst

Thank you for the explanation!



* Update docs/docsite/rst/inventory_guide_iocage_aliases.rst



* Updated docs Inventory Guide.

* Problematic pygments changed to 'console'.

* Update docs/docsite/rst/inventory_guide_iocage_hooks.rst
  Update docs/docsite/rst/inventory_guide_iocage_properties.rst
  Update docs/docsite/rst/inventory_guide_iocage_hooks.rst



* Put dhclient-exit-hooks into the sh code-block.

* Fix the code-block.

* Update docs/docsite/rst/inventory_guide_iocage.rst
  Update docs/docsite/rst/inventory_guide_iocage_aliases.rst
  Update docs/docsite/rst/inventory_guide_iocage_basics.rst



* Remove tabs.

* Update docs/docsite/rst/inventory_guide_iocage_basics.rst



* Indent the note block.

* Update docs/docsite/rst/inventory_guide_iocage_hooks.rst
  Update docs/docsite/rst/inventory_guide_iocage_dhcp.rst
  Update docs/docsite/rst/inventory_guide_iocage_hooks.rst



* Fix ansval.

* Add guide_iocage.rst and inventory_guide_iocage*.rst

* Fix 'disallowed language sh found'.

* Remove note block.

* Remove include which triggers a bug in rstcheck.

* Update docs/docsite/extra-docs.yml
  Update docs/docsite/rst/iocage_inventory_guide_basics.rst
  Update docs/docsite/rst/iocage_inventory_guide_dhcp.rst
  Update docs/docsite/rst/iocage_inventory_guide_hooks.rst
  Update docs/docsite/rst/iocage_inventory_guide_properties.rst
  Update docs/docsite/rst/iocage_inventory_guide_tags.rst
  Update docs/docsite/rst/iocage_inventory_guide_hooks.rst
  Update docs/docsite/rst/iocage_inventory_guide_properties.rst



* Put man iocage quotation into the text code block.

---------



(cherry picked from commit 563b29e)

Co-authored-by: Vladimir Botka <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Alexei Znamensky <[email protected]>
@vbotka vbotka deleted the docs-guide-inventory branch July 12, 2025 22:41
@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Jul 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-11 Automatically create a backport for the stable-10 branch docs has_issue needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants