# How to remember state?

**URL:** <https://forum.ansible.com/t/how-to-remember-state/16257>\
**Category:** Ansible Project\
**Created:** [September 17, 2014, 3:37pm UTC](https://forum.ansible.com/t/how-to-remember-state/16257 "2014-09-17T15:37:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hilco\_Wijbenga](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Hilco\_Wijbenga](https://forum.ansible.com/u/Hilco_Wijbenga)\
**Post date:** [September 17, 2014, 3:37pm UTC](https://forum.ansible.com/t/how-to-remember-state/16257/1 "2014-09-17T15:37:31Z")

</div>

Hi all,

Let's say we have a role-a with two tasks: task-1 and task-2. Task-2  
only runs if task-1 has triggered a change. So far, so good. But what  
happens when task-2 fails? If we rerun role-a then task-1 will not  
trigger a change so task-2 will not run. But we still need it to run.

Is there a way to "remember" the fact that task-2 should run? The best  
I can come up with is to create a task-2-must-run empty marker file  
somewhere when task-1 triggers a change [and assume that creating said  
file will never fail 🙂 ]. Then have task-2 trigger on the existence  
of the marker file.

That seems possible but rather convoluted. Thoughts?

Cheers,  
Hilco

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [September 17, 2014, 5:31pm UTC](https://forum.ansible.com/t/how-to-remember-state/16257/2 "2014-09-17T17:31:01Z")

</div>

Hi Hilco, you can use the --start-at-task option to start execution of a playbook at a given task. The --step option can also be used, which asks if you wish to skip each task in the playbook (you can give it an answer to stop prompting and just run as well).

I am just now noticing that there doesn’t appear to be any documentation regarding these options on our docs site, so I’ll create a github issue for that as well.

Finally, when a task fails, a “retry” file is created, which you can use to re-execute on hosts which have failed.

Thanks!
