-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
base: main
Are you sure you want to change the base?
Added docs Inventory Guide. #10239
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this 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.
|
||
See: `Configuring a Shared IP Jail <https://iocage.readthedocs.io/en/latest/networking.html#configuring-a-shared-ip-jail>`_ | ||
|
||
* If iocage needs environment variable(s), use the option *env*. For example, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since env
is an option of the plugin, use :ansopt:
to reference that option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope I updated what you wanted.
I think @felixfontein 's line of thought makes sense, these guides should be put together as |
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 :) |
Okie, I'll do the same - but not today |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of comments
.. 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 withyaml
.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
.. 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 |
There was a problem hiding this comment.
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.
I changed the pygment to sh. Quoting man dhclient-script:
|
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
|
There was a problem hiding this 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:
docs/docsite/rst/inventory_guide.rst
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. After the references are clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this file to iocage_inventory_guide.rst
, and rename the other files accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dtto
For the record:
|
Yep, sorry, it's |
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
a6e0c00
to
1c91a91
Compare
For the record: |
For the record:
There are only two
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename this and the other iocage_inventory_guide_*
files to guide_iocage_inventory_*
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. You already asked me to rename them to iocage_inventory_guide_*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I forgot about that. I think guide_iocage_inventory_*
is better than the current name though; I'll create a PR once this is merged.
The error message should list the allowed languages. Use |
PROPERTIES | ||
... | ||
notes="any string" | ||
Custom notes for miscellaneous tagging. | ||
Default: none | ||
Source: local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be a code block (with language text
)?
|
||
We will use the format `notes="tag1=value1 tag2=value2 ..."`. | ||
|
||
Note: The iocage tags has nothing to do with the :ref:`tags` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: The iocage tags has nothing to do with the :ref:`tags` | |
.. note:: | |
The iocage tags have nothing to do with the :ref:`tags`. |
:ansopt:`community.general.iocage#inventory:get_properties` must be enabled: | ||
|
||
.. code-block:: console | ||
|
||
shell> cat hosts/02_iocage.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:ansopt:`community.general.iocage#inventory:get_properties` must be enabled: | |
.. code-block:: console | |
shell> cat hosts/02_iocage.yml | |
:ansopt:`community.general.iocage#inventory:get_properties` must be enabled. | |
For example, ``hosts/02_iocage.yml`` could look like: |
Display tags and groups. Create a playbook: | ||
|
||
.. code-block:: console | ||
|
||
shell> cat pb-test-groups.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Display tags and groups. Create a playbook: | |
.. code-block:: console | |
shell> cat pb-test-groups.yml | |
Display tags and groups. Create a playbook ``pb-test-groups.yml``: |
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
SUMMARY
Add Inventory (Plugin) Guide
ISSUE TYPE
COMPONENT NAME
NA
ADDITIONAL INFORMATION
NA