-
Notifications
You must be signed in to change notification settings - Fork 659
add details on some plugin options - AI-assisted #2813
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: devel
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -63,18 +63,66 @@ To define configurable options for your plugin, describe them in the ``DOCUMENTA | |||||||||
description: describe this config option | ||||||||||
default: default value for this config option | ||||||||||
env: | ||||||||||
- name: NAME_OF_ENV_VAR | ||||||||||
- name: MYCOLLECTION_NAME_OF_ENV_VAR | ||||||||||
ini: | ||||||||||
- section: section_of_ansible.cfg_where_this_config_option_is_defined | ||||||||||
key: key_used_in_ansible.cfg | ||||||||||
- section: mycollection_section_of_ansible.cfg_where_this_config_option_is_defined | ||||||||||
key: mycollection_key_used_in_ansible.cfg | ||||||||||
vars: | ||||||||||
- name: name_of_ansible_var | ||||||||||
- name: name_of_second_var | ||||||||||
- name: mycollection_name_of_ansible_var | ||||||||||
- name: mycollection_name_of_second_var | ||||||||||
version_added: X.x | ||||||||||
required: True/False | ||||||||||
type: boolean/float/integer/list/none/path/pathlist/pathspec/string/tmppath | ||||||||||
version_added: X.x | ||||||||||
|
||||||||||
The supported configuration fields are: | ||||||||||
|
||||||||||
**env** | ||||||||||
List of environment variables that can be used to set this option. | ||||||||||
Each entry includes a ``name`` field specifying the environment variable name. | ||||||||||
The name should be in uppercase and should be prefixed with the collection name. | ||||||||||
Multiple environment variables can be listed for the same option. | ||||||||||
The last environment variable in the list takes precedence if multiple are set. | ||||||||||
This is commonly used for plugins (especially inventory plugins) to allow configuration through environment variables. | ||||||||||
|
||||||||||
|
||||||||||
**ini** | ||||||||||
List of configuration file settings that can be used to set this option. | ||||||||||
Each entry includes a ``section`` field for the configuration file section and a ``key`` field for the configuration key. Both should be in lowercase and should be prefixed with the collection name. | ||||||||||
Multiple configuration settings can be listed for the same option. | ||||||||||
felixfontein marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
The last configuration setting in the list takes precedence if multiple are set. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here:
Suggested change
|
||||||||||
This allows plugins to be configured via ansible.cfg. | ||||||||||
|
||||||||||
|
||||||||||
**vars** | ||||||||||
List of Ansible variables that can be used to set this option. | ||||||||||
Each entry includes a ``name`` field specifying the variable name. | ||||||||||
The name should be in lowercase and should be prefixed with the collection name. | ||||||||||
Multiple variables can be listed for the same option. | ||||||||||
felixfontein marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
The last variable in the list takes precedence if multiple are set. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here:
Suggested change
|
||||||||||
Variables follow Ansible's variable precedence rules. | ||||||||||
This allows plugins to be configured via Ansible variables. | ||||||||||
|
||||||||||
.. _general_plugin_precedence_rules: | ||||||||||
|
||||||||||
General precedence rules | ||||||||||
------------------------ | ||||||||||
|
||||||||||
The precedence rules for configuration sources are listed below,starting with the highest precedence values: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
* Direct specification | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we mention here that this is not possible for every plugin type?
Suggested change
|
||||||||||
* Ansible variables | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also not available for all plugin types (for example for inventory plugins). Maybe we should not add such information in this section, but have it somewhere else... |
||||||||||
* Keywords | ||||||||||
* CLI settings | ||||||||||
* Environment variables | ||||||||||
* Values defined in ``ansible.cfg`` | ||||||||||
* Option's default value, if present. None if there is no default. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe we should also simply write:
Suggested change
since |
||||||||||
|
||||||||||
.. _accessing_configuration_settings: | ||||||||||
|
||||||||||
Accessing configuration settings | ||||||||||
-------------------------------- | ||||||||||
|
||||||||||
felixfontein marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
To access the configuration settings in your plugin, use ``self.get_option(<option_name>)``. | ||||||||||
Some plugin types handle this differently: | ||||||||||
|
||||||||||
|
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.
Maybe we should say "last set" instead of "last":