Best practice and approach on how to check if the service is started and start if it is not

24 views
Skip to first unread message

wiggler

unread,
Aug 3, 2016, 6:23:52 PM8/3/16
to Ansible Project
Hello all,

I would like to automate the checking of the services if is it properly chkconfig on and set to on if its off and start. also need to check if the service is on then start if its off in RHEL6.

Thanks.

Bryan Pearson

unread,
Aug 3, 2016, 8:47:18 PM8/3/16
to Ansible Project
Hello,

Is there a specific importance to knowing this?
Ansible can be set to start a process if its not running and also add the chkconfig as needed.

# Example action to start service httpd, if not running
- service: name=httpd state=started enabled=yes
Should be enough to resolve it for you.

Reply all
Reply to author
Forward
0 new messages