# Best Practice for a reusable task and its output

**URL:** <https://forum.ansible.com/t/best-practice-for-a-reusable-task-and-its-output/30318>\
**Category:** Ansible Project\
**Created:** [May 13, 2019, 2:53pm UTC](https://forum.ansible.com/t/best-practice-for-a-reusable-task-and-its-output/30318 "2019-05-13T14:53:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jyotsna\_Mehta](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@Jyotsna\_Mehta](https://forum.ansible.com/u/Jyotsna_Mehta)\
**Post date:** [May 13, 2019, 2:53pm UTC](https://forum.ansible.com/t/best-practice-for-a-reusable-task-and-its-output/30318/1 "2019-05-13T14:53:50Z")

</div>

What is the best practice to place a task that will be used multiple times across a playbook and the output of this task will be used in the conditionals of the main tasks? I am writing a playbook that

- does app server patching
- checks the server status and based on the status performs a few tasks
- the checks are performed multiple times within the playbook and the output var is used in the condition for the next task
