# set\_fact vs register

**URL:** <https://forum.ansible.com/t/set-fact-vs-register/15945>\
**Category:** Ansible Project\
**Created:** [August 14, 2014, 9:55am UTC](https://forum.ansible.com/t/set-fact-vs-register/15945 "2014-08-14T09:55:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steven\_Ringo](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Steven\_Ringo](https://forum.ansible.com/u/Steven_Ringo)\
**Post date:** [August 14, 2014, 9:55am UTC](https://forum.ansible.com/t/set-fact-vs-register/15945/1 "2014-08-14T09:55:48Z")

</div>

Hi,

Apart from the fact that **set\_fact** is a task on its own and **register** captures the result of a task, is there any difference between the resulting variables’ scope or lifecycle (or anything else) for example.

Thanks,

Steve

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 14, 2014, 11:34am UTC](https://forum.ansible.com/t/set-fact-vs-register/15945/2 "2014-08-14T11:34:25Z")

</div>

Fundamentally they do the same thing, though “register” applies to task results.

They enter into the same per-inventory-host scope.
