Inside my playbook I\'d like to create a variable holding the output of an external command. Afterwards I want to make use of that variable in a couple of templates.
There's no need to set a fact.
- shell: cat "hello" register: cat_contents - shell: echo "I cat hello" when: cat_contents.stdout == "hello"