An organization uses custom Ansible plugins stored in a collection. A junior admin reports that after updating the collection to version 2.0.0, a playbook that uses a custom filter plugin fails with 'undefined filter'. What is the most likely cause?
Trap 1: The playbook uses an outdated syntax that is incompatible with the…
Version updates typically maintain backward compatibility for filter syntax.
Trap 2: The playbook does not use the fully qualified collection name…
FQCN is not required if the collection is listed in the playbook's collections keyword.
Trap 3: The collection's metadata file galaxy.yml is missing a dependency…
Missing dependencies would cause a different error.
- A
The playbook uses an outdated syntax that is incompatible with the new collection.
Why it fails: Version updates typically maintain backward compatibility for filter syntax.
- B
The filter plugin was placed in the wrong directory inside the collection.
Filter plugins must reside in the `plugins/filter/` directory of the collection; placing them elsewhere means Ansible's plugin loader never registers them, producing the 'undefined filter' error. Since the failure appeared only after the 2.0.0 update, the plugin's location within the collection was likely changed during that release.
- C
The playbook does not use the fully qualified collection name (FQCN) for the filter.
Why it fails: FQCN is not required if the collection is listed in the playbook's collections keyword.
- D
The collection's metadata file galaxy.yml is missing a dependency declaration.
Why it fails: Missing dependencies would cause a different error.