# include task and when doesn't completely skip, variables is overwritten.

**URL:** <https://forum.ansible.com/t/include-task-and-when-doesnt-completely-skip-variables-is-overwritten/22527>\
**Category:** Ansible Project\
**Created:** [September 12, 2016, 11:08am UTC](https://forum.ansible.com/t/include-task-and-when-doesnt-completely-skip-variables-is-overwritten/22527 "2016-09-12T11:08:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [September 12, 2016, 11:08am UTC](https://forum.ansible.com/t/include-task-and-when-doesnt-completely-skip-variables-is-overwritten/22527/1 "2016-09-12T11:08:52Z")

</div>

Hi

I have this simple example.  
It work as expected in v2.0.2 but not in 2.1.1

task1.yml

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [September 12, 2016, 12:33pm UTC](https://forum.ansible.com/t/include-task-and-when-doesnt-completely-skip-variables-is-overwritten/22527/2 "2016-09-12T12:33:07Z")

</div>

skipping a task does not skip the registering of variables, as this contains the status of the skipped task for latter testing:

when: result|skipped

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [September 13, 2016, 8:18am UTC](https://forum.ansible.com/t/include-task-and-when-doesnt-completely-skip-variables-is-overwritten/22527/3 "2016-09-13T08:18:44Z")

</div>

Thanks Brian.

I'll rewrite my affected roles before upgrade to 2.1.
