--- - name: Verify hosts: all become: yes gather_facts: no tasks: - name: record status of .ssh stat: path: /home/keyuser/.ssh register: result failed_when: - not result.stat.exists - name: check if user notuser does not exist user: name: notuser state: absent register: users_check_user_notuser failed_when: - users_check_user_notuser is changed