[PR #2037/65293909 backport][stable-2] New Filter plugin from_csv #2074
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backport of PR #2037 as merged into main (6529390).
SUMMARY
This filter adapts the csv parsing features from the read_csv module to use directly with ansible text/variables
Fixes: #1881
ISSUE TYPE
COMPONENT NAME
plugins/filter/from_csv.py
plugins/modules/read_csv.py
plugins/module_utils/csv.py
ADDITIONAL INFORMATION
Feature set and core implementation is pulled directly from read_csv and adapted to the filter structure.
Common functions have been refactored into module_utils/csv.py which both read_csv and from_csv utilize
Notable Changes:
Integration tests were added which cover basic functions, but could be updated for better coverage.
Unit tests also added for csv.py.
Wasn't sure how to properly credit the author of read_csv so I updated copyright as if it was an update to the original module