Нет необходимости устанавливать факт.
- shell: cat "hello" register: cat_contents - shell: echo "I cat hello" when: cat_contents.stdout == "hello"