# filter\_plugins cannot be used inside role defaults

**URL:** <https://forum.ansible.com/t/filter-plugins-cannot-be-used-inside-role-defaults/25660>\
**Category:** Ansible Project\
**Created:** [October 2, 2017, 6:34pm UTC](https://forum.ansible.com/t/filter-plugins-cannot-be-used-inside-role-defaults/25660 "2017-10-02T18:34:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deniz\_Acay](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@Deniz\_Acay](https://forum.ansible.com/u/Deniz_Acay)\
**Post date:** [October 2, 2017, 6:34pm UTC](https://forum.ansible.com/t/filter-plugins-cannot-be-used-inside-role-defaults/25660/1 "2017-10-02T18:34:19Z")

</div>

Hi,

We recently migrated to Ansible v2.4 and having issues related to using our role-specific custom filter plugins in role defaults.

In previous version, this worked:

- myrole  
&nbsp;&nbsp;&nbsp;&nbsp;- defaults  
&nbsp;&nbsp;&nbsp;&nbsp;- filter\_plugins  
&nbsp;&nbsp;&nbsp;&nbsp;- tasks

We could use filter plugins defined in this role in the defaults variables but this does not work any more.

It fails with error "template error while templating string: no filter named 'some\_filter'." But we can use those filters in tasks.

Is this something expected? We are trying to make the playbook work again, with minimum modification. Any suggestions?

Thanks in advance.
