# Filter plugins wont be loaded

**URL:** <https://forum.ansible.com/t/filter-plugins-wont-be-loaded/45092>\
**Category:** Get Help\
**Tags:** plugin\
**Created:** [January 13, 2026, 3:09pm UTC](https://forum.ansible.com/t/filter-plugins-wont-be-loaded/45092 "2026-01-13T15:09:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![schuert](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/schuert/32/7494_2.png) [@schuert](https://forum.ansible.com/u/schuert)\
**Post date:** [January 13, 2026, 3:09pm UTC](https://forum.ansible.com/t/filter-plugins-wont-be-loaded/45092/1 "2026-01-13T15:09:21Z")

</div>

Hi Guiys,

I have Problems with self written filter\_plugins that worked flawlessly in the past.

I’m executing ansible playbooks via gitlab-runner in our infrastructure. In the past we used a runner of type shell. Some roles use additional filter plugins that are provided via rolename/filter\_plugins/myfilter.py which worked as intended with ansible 2.17.

At the moment I’m implementing a new runner that uses docker container with ansible 2.20 which works the same but uses a different folder structure and a newer ansible version. The playbooks and roles didn’t change.

Structur:  
pwd = playbookdir  
playbookdir/playbook.yml  
playbookdir/roles/testrole  
playbookdir/roles/testrole/filter\_plugins

when executing the playbook the task that uses a filter\_plugin from testrole/filter\_plugins/myfilter.py wont load the plugin and errors out.

Even setting ANSIBLE\_FILTER\_PLUGINS to the directory or copying the plugin to /usr/lib/python3/dist…/plugins/filter doesn’t work. Setting ANSIBLE\_DEBUG=1 I see that ansible doesn’t even attempt to load the plugin.

Any Ideas why this doesn’t work any longer? Does anything regarding filter plugins changed in versions \> 2.17?

All help is appreciated.

Kind Regards  
schuert

---

<div class="post-metadata">

**Author:** ![bvitnik](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bvitnik/32/4132_2.png) [@bvitnik](https://forum.ansible.com/u/bvitnik)\
**Post date:** [January 13, 2026, 3:32pm UTC](https://forum.ansible.com/t/filter-plugins-wont-be-loaded/45092/2 "2026-01-13T15:32:59Z")

</div>

Documentation states that nothing changed in that part:

> **[Adding modules and plugins locally — Ansible Community Documentation](https://docs.ansible.com/projects/ansible/latest/dev_guide/developing_locally.html)**

Quote:

> To use a standalone plugin only in a single role, store the plugin in a subdirectory for the correct `plugin_type` (for example, `cache_plugins` or `strategy_plugins`) within that role. When shipped as part of a role, the plugin is available as soon as the role is executed. These directories must use the `_plugins` suffix. For a full list of plugin types, see [Working with plugins](https://docs.ansible.com/projects/ansible/latest/plugins/plugins.html#working-with-plugins).

Could it be that you are using the newer Python version and your plugin is not compatible with it? Maybe Ansible is just not reporting failed plugin imports so you don’t see the real reason it skipped the plugin.

---

<div class="post-metadata">

**Author:** ![schuert](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/schuert/32/7494_2.png) [@schuert](https://forum.ansible.com/u/schuert)\
**Post date:** [January 13, 2026, 3:53pm UTC](https://forum.ansible.com/t/filter-plugins-wont-be-loaded/45092/3 "2026-01-13T15:53:23Z")

</div>

both runner are using python3.12 and are bookworm based. the docker container uses the baseimage python3.12-slim-bookworm. There should be no difference in the python version, as far as i can tell.

the filter plugin is stored inside the role and has worked the last 2 years without a problem:  
rolename/filter\_plugins/myfilter.py

I’m out of ideas. The biggest difference is that the container uses an ansible version installed via pip, the old shell runner the debian apt package. maybe im missing some dependencies?

---

<div class="post-metadata">

**Author:** ![schuert](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/schuert/32/7494_2.png) [@schuert](https://forum.ansible.com/u/schuert)\
**Post date:** [January 13, 2026, 4:22pm UTC](https://forum.ansible.com/t/filter-plugins-wont-be-loaded/45092/4 "2026-01-13T16:22:28Z")

</div>

Found the error, must have missed it in previous runs:

[WARNING]: Skipping plugin (/builds/ansible/playbooks/infrastructure/network/exos/exos\_configure\_ntp/filter\_plugins/exos\_filter.py), cannot load: cannot import name ‘passlib\_or\_crypt’ from ‘ansible.utils.encrypt’ (/usr/local/lib/python3.12/site-packages/ansible/utils/encrypt.py)  
[WARNING]: Skipping plugin (/builds/ansible/playbooks/infrastructure/network/exos/exos\_configure\_ntp/roles/exos\_facts/filter\_plugins/exos\_filter.py), cannot load: cannot import name ‘passlib\_or\_crypt’ from ‘ansible.utils.encrypt’ (/usr/local/lib/python3.12/site-packages/ansible/utils/encrypt.py)

The plugin started as a copy of the vlan\_parser plugin and tried to import passlib\_or\_crypt for whatever reason, which was not available. Instead of fixing the dependency error I just removed the import since that module was never used in the filter anyway.

Thank you and have a nice day!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [February 12, 2026, 4:22pm UTC](https://forum.ansible.com/t/filter-plugins-wont-be-loaded/45092/5 "2026-02-12T16:22:44Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
