Skip to content
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

Add inventory filter capability #698

Merged
merged 4 commits into from
Jan 13, 2024

Conversation

felixfontein
Copy link
Collaborator

@felixfontein felixfontein commented Oct 15, 2023

SUMMARY

Adds a filter option to all inventory plugins which allows to exclude/include hosts based on Jinja2 expressions.

This is a generic mechanism which can also be used in other inventory plugins (outside of this collection), similar to the Constructable mixin from ansible-core.

Fixes #610.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

inventory plugins

Copy link
Contributor

@briantist briantist left a comment

Choose a reason for hiding this comment

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

This is very cool! While it might be weird to take a dependency on c.docker for this alone, the plugin_util isn't named with an underscore or a notice about it being private. Would it be considered fair game to use it in that case? I don't have any plans to right now, just mentioning in case you didn't want to have to keep breaking changes to major versions or whatever.

@felixfontein
Copy link
Collaborator Author

IMO using this plugin_utils / docs_fragment from community.docker in other collections would be fine. If you plan to do so (especially with public collections) please make sure you test against the current main branch of community.docker as well, to early on catch breaking changes should they ever arise (intentionally or not).

@felixfontein
Copy link
Collaborator Author

felixfontein commented Dec 8, 2023

The docs build error is expected as the workflow is run from the main branch. (Edit: I added 48f48a0 to main so this should no longer fail.)

@felixfontein
Copy link
Collaborator Author

felixfontein commented Jan 12, 2024

The dependency is now part of Ansible, so it's time to continue this :)

Ref: ansible-community/ansible-build-data#352

@felixfontein
Copy link
Collaborator Author

recheck

1 similar comment
@felixfontein
Copy link
Collaborator Author

recheck

@felixfontein
Copy link
Collaborator Author

Too bad if third-party-check fails...

@felixfontein felixfontein merged commit f429017 into ansible-collections:main Jan 13, 2024
120 of 121 checks passed
@felixfontein felixfontein deleted the inv branch January 13, 2024 14:51
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jan 30, 2024
9.2.0

Major Changes
-------------

community.docker
~~~~~~~~~~~~~~~~

- The ``community.docker`` collection now depends on the ``community.library_inventory_filtering_v1`` collection. This utility collection provides host filtering functionality for inventory plugins. If you use the Ansible community package, both collections are included and you do not have to do anything special. If you install the collection with ``ansible-galaxy collection install``, it will be installed automatically. If you install the collection by copying the files of the collection to a place where ansible-core can find it, for example by cloning the git repository, you need to make sure that you also have to install the dependency if you are using the inventory plugins (ansible-collections/community.docker#698).

community.hashi_vault
~~~~~~~~~~~~~~~~~~~~~

- requirements - the ``requests`` package which is required by ``hvac`` now has a more restrictive range for this collection in certain use cases due to breaking security changes in ``ansible-core`` that were backported (ansible-collections/community.hashi_vault#416).

dellemc.openmanage
~~~~~~~~~~~~~~~~~~

- All OME modules are enhanced to support the environment variables `OME_USERNAME` and `OME_PASSWORD` as fallback for credentials.
- All iDRAC and Redfish modules are enhanced to support the environment variables `IDRAC_USERNAME` and `IDRAC_PASSWORD` as fallback for credentials.
- idrac_certificates - The module is enhanced to support the import and export of `CUSTOMCERTIFICATE`.
- idrac_gather_facts - This role is enhanced to support secure boot.
- idrac_license - The module is introduced to configure iDRAC licenses.

infoblox.nios_modules
~~~~~~~~~~~~~~~~~~~~~

- Upgrade Ansible version support from 2.13 to 2.16.
- Upgrade Python version support from 3.8 to 3.10.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Offer an include/exclude containers based on a filtering options in the Docker dynamic inventory
2 participants