Background
ansible 执行 shell 报错:“msg”: “non-zero return code”, “rc”: 1
playbook 配置
- name: check apache httpd progress
command: /bin/bash -c "ps -ef | grep apache | grep -v apache"
register: ps_apache
报错信息
TASK [apache : check apache httpd progress] ********************************************************************************************************************************
fatal: [10.222.6.180]: FAILED! => {“changed”: true, “cmd”: ["/bin/bash", “-c”, “ps -ef | grep apache | grep -v apache”], “delta”: “0:00:00.021526”, “end”: “2019-12-25 11:19:16.191242”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2019-12-25 11:19:16.169716”, “stderr”: “”, “stderr_lines”: [], “stdout”: “”, “stdout_lines”: []}
fatal: [10.241.81.70]: FAILED! => {“changed”: true, “cmd”: ["/bin/bash", “-c”, “ps -ef | grep apache | grep -v apache