# Using the filter\_plugins in conditional when

**URL:** <https://forum.ansible.com/t/using-the-filter-plugins-in-conditional-when/33729>\
**Category:** Ansible Project\
**Created:** [September 2, 2020, 1:42pm UTC](https://forum.ansible.com/t/using-the-filter-plugins-in-conditional-when/33729 "2020-09-02T13:42:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafael\_Tomelin](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Rafael\_Tomelin](https://forum.ansible.com/u/Rafael_Tomelin)\
**Post date:** [September 2, 2020, 1:42pm UTC](https://forum.ansible.com/t/using-the-filter-plugins-in-conditional-when/33729/1 "2020-09-02T13:42:49Z")

</div>

Hi dear,

I created the filter\_plugin that check if running process and return true or false. This is an example:

process\_name|get\_processes

I want to create this task:

**- name: start service**  
**shell: /usr/local/bin/my\_script**  
**when: process\_name|get\_processes is false**

But it seems to me that the conditional does not accept filter\_plugin.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [September 2, 2020, 5:27pm UTC](https://forum.ansible.com/t/using-the-filter-plugins-in-conditional-when/33729/2 "2020-09-02T17:27:14Z")

</div>

Isn’t this what systemd is supposed to be for?  
If you deploy a proper systemd unit, you can use the service module.
