# Variables, task variables and set\_fact

**URL:** <https://forum.ansible.com/t/variables-task-variables-and-set-fact/36415>\
**Category:** Ansible Project\
**Created:** [March 9, 2022, 2:15pm UTC](https://forum.ansible.com/t/variables-task-variables-and-set-fact/36415 "2022-03-09T14:15:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Jensen](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@Alexander\_Jensen](https://forum.ansible.com/u/Alexander_Jensen)\
**Post date:** [March 9, 2022, 2:15pm UTC](https://forum.ansible.com/t/variables-task-variables-and-set-fact/36415/1 "2022-03-09T14:15:16Z")

</div>

Hello,

can someone help me to understand the behavior?

**Playbook:**

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [March 9, 2022, 2:29pm UTC](https://forum.ansible.com/t/variables-task-variables-and-set-fact/36415/2 "2022-03-09T14:29:41Z")

</div>

`vars` on `include_tasks` are considered “include params” which is 21 on the precedence chart. `set_fact` is 19 on that list, and `vars` on `import_tasks` are considered “task vars” which are 17.

[https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_variables.html#variable-precedence-where-should-i-put-a-variable](https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable)
