* Add fact_diff action * Formatting * Update docs * Add skip_lines * Update docs * black * bug fix * Add units for fact_diff * Initial changes to support plugin architecture * Restructure docstring * Integration test fix * Wrap diff plugin with try/except * Fix integration test * Restructure code to allow for plugin failure test * Examples, docs * Fix debug statement * Update examples * Minor doc updates * Minor doc updates * Minor doc updates * Add change log Co-authored-by: cidrblock <brad@thethorntons.net> |
||
---|---|---|
.github/workflows | ||
changelogs | ||
docs | ||
meta | ||
plugins | ||
tests | ||
.gitignore | ||
CHANGELOG.rst | ||
LICENSE | ||
README.md | ||
galaxy.yml |
README.md
Ansible Utilities Collection
The Ansible ansible.utils
collection includes a variety of plugins that aid in the management, manupulation and visibility of data for the Ansible playbook developer.
Ansible version compatibility
This collection has been tested against following Ansible versions: >=2.9.10,<2.11.
Plugins and modules within a collection may be tested with only specific Ansible versions. A collection may contain metadata that identifies these versions. PEP440 is the schema used to describe the versions of Ansible.
Included content
Filter plugins
Name | Description |
---|---|
ansible.utils.get_path | Retrieve the value in a variable using a path |
ansible.utils.index_of | Find the indicies of items in a list matching some criteria |
ansible.utils.to_paths | Flatten a complex object into a dictionary of paths and values |
Lookup plugins
Name | Description |
---|---|
ansible.utils.get_path | Retrieve the value in a variable using a path |
ansible.utils.index_of | Find the indicies of items in a list matching some criteria |
ansible.utils.to_paths | Flatten a complex object into a dictionary of paths and values |
Modules
Name | Description |
---|---|
ansible.utils.fact_diff | Find the difference between currently set facts |
ansible.utils.update_fact | Update currently set facts |
Installing this collection
You can install the ansible.utils
collection with the Ansible Galaxy CLI:
ansible-galaxy collection install ansible.utils
You can also include it in a requirements.yml
file and install it with ansible-galaxy collection install -r requirements.yml
, using the format:
---
collections:
- name: ansible.utils
Using this collection
The most common use case for this collection is when complex data structures are present in an Ansible playbook, inventory, or returned from modules are worked with.
NOTE: For Ansible 2.9, you may not see deprecation warnings when you run your playbooks with this collection. Use this documentation to track when a module is deprecated.
See Also:
- Ansible Using collections for more details.
Contributing to this collection
This collection is intended for plugins that are not platform or discipline specific. Simple plugin examples should be generic in nature, more complex examples can include real world platform module to demonstrate the utility of the plugin in a playbook.
We welcome community contributions to this collection. If you find problems, please open an issue or create a PR against the ansible.utils collection repository. See Contributing to Ansible-maintained collections for complete details.
See the Ansible Community Guide for details on contributing to Ansible.
Developer notes
- 100% code coverage is the goal, although it's not always possible. Please include unit and integration tests with all PRs. PRs should not cause a decrease in code coverage.
- filter plugins should be 1 per file, with an included DOCUMENTATION string/or reference a lookup plugin with the same name.
- action, filter and lookup plugins should use argspec validation, see AnsibleArgSpecValidator
- This collection should not depend on other collections for imported code
- Use of the latest version of black is required for formatting (black -l79)
- The README contains a table of plugins, the collection_prep utilities make this easy to maintain
Code of Conduct
This collection follows the Ansible project's Code of Conduct. Please read and familiarize yourself with this document.
Release notes
Release notes are available here
Roadmap
More information
- Ansible Collection overview
- Ansible User guide
- Ansible Developer guide
- Ansible Community code of conduct
Licensing
GNU General Public License v3.0 or later.
See LICENSE to see the full text.