xxxxxxxxxx
---
- hosts: all
tasks:
- name: ps command
shell: ps | grep foo
register: ps
failed_when: ps.rc not in [ 0, 1 ]
xxxxxxxxxx
---
- hosts: all
tasks:
- name: ps command
shell: ps | grep foo
- meta: clear_host_error
xxxxxxxxxx
---
- hosts: all
tasks:
- name: ps command
shell: ps | grep foo
ignore_errors: true