Using the filter_plugins in conditional when

8 views
Skip to first unread message

Rafael Tomelin

unread,
Sep 2, 2020, 9:43:28 AM9/2/20
to ansible...@googlegroups.com
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.

--
Atenciosamente,

Rafael Tomelin
Tel.: 51-984104084
Skype: rafael.tomelin

LPI ID: LPI000191271
Red Hat Certified Engineer
Puppet Professional 2017 Certification

Dick Visser

unread,
Sep 2, 2020, 1:27:47 PM9/2/20
to ansible...@googlegroups.com
Isn't this what systemd is supposed to be for?
If you deploy a proper systemd unit, you can use the service module.

--


You received this message because you are subscribed to the Google Groups "Ansible Project" group.


To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.


To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAGEUqbDLJ%2BqXtCOvrPELFQA9OeoSG7Q-p7kZbAdW0yvVRuftKw%40mail.gmail.com.


--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.
Reply all
Reply to author
Forward
0 new messages