Hello,
I want to check if a process to run on my server by using the ps command:
- name: Test if openhr runs
shell: ps -ef | grep -v grep | grep {{ ansible_user }} | grep dispatcher | grep {{ rep_user }}/{{ openhrname }}/bin
register: procopenhr
I receive the following error message, I cannot figure out what's wrong with my command:
TASK [openhr : Test if openhr runs] ******************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "ps -ef | grep -v grep | grep fval | grep dispatcher | grep home/fval/openhr/bin", "delta": "0:00:00.011877", "end": "2016-05-24 12:36:58.184606", "failed": true, "rc": 1, "start": "2016-05-24 12:36:58.172729", "stderr": "", "stdout": "", "stdout_lines": [], "warnings": []}
I tried with quoting the last grep, without success: "grep {{ rep_user }}/{{ openhrname }}/bin"
What is wrong ?
Regards