# Mark playbook execution as complete when certain file is present in remote system

**URL:** <https://forum.ansible.com/t/mark-playbook-execution-as-complete-when-certain-file-is-present-in-remote-system/21969>\
**Category:** Ansible Project\
**Created:** [July 9, 2016, 3:40pm UTC](https://forum.ansible.com/t/mark-playbook-execution-as-complete-when-certain-file-is-present-in-remote-system/21969 "2016-07-09T15:40:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zeal\_Vora](https://avatars.discourse-cdn.com/v4/letter/z/e79b87/32.png) [@Zeal\_Vora](https://forum.ansible.com/u/Zeal_Vora)\
**Post date:** [July 9, 2016, 3:40pm UTC](https://forum.ansible.com/t/mark-playbook-execution-as-complete-when-certain-file-is-present-in-remote-system/21969/1 "2016-07-09T15:40:21Z")

</div>

Hi

We are planning to run our infrastructure on Ansible Pull Mode so all the host machines will keep on polling every few minutes.

In a single outside.yml file, we will have around 8 playbooks.

I want to mark a specific whole playbook as completed if there is certain file present in a remote system.

What is the most ideal way to achieve this ?

---

<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:** [July 11, 2016, 1:58pm UTC](https://forum.ansible.com/t/mark-playbook-execution-as-complete-when-certain-file-is-present-in-remote-system/21969/2 "2016-07-11T13:58:04Z")

</div>

It's not possible to mark the execution as complete, but you could skip a role.

Put the playbook in its own file, lets say play1.yml

In outside.yml use stat module to check if the file exist and register the result in a variable e.g. result and then you can include the role like this

- include: play.yml  
&nbsp;&nbsp;&nbsp;when: result.stat.exists == false
