On 01.10.21 02:10, subbamma natla wrote:
can somebody explaine me why service sis not starting
on mhost1:
[root@mhost1 ~]# ps -ef | grep -v grep | grep httpd
It might be cleaner to use pgrep instead for process check. Then you can use
something like this:
tasks:
- name: Process check
command: pgrep httpd
register: httpd_check
ignore_errors: true
- debug:
var: httpd_check.failed
- name: restart httpd if down
systemd:
name: httpd
state: restarted
when: httpd_check.failed
--
https://blog.sandipb.net
https://twitter.com/sandipb
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/934119b9-4e3e-75a9-975f-65ad80fee947%40showmethesource.org.