# Trigger restart of service only when certain files exist?

**URL:** <https://forum.ansible.com/t/trigger-restart-of-service-only-when-certain-files-exist/14732>\
**Category:** Ansible Project\
**Created:** [March 9, 2014, 2:00am UTC](https://forum.ansible.com/t/trigger-restart-of-service-only-when-certain-files-exist/14732 "2014-03-09T02:00:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grayson\_Koonce](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@Grayson\_Koonce](https://forum.ansible.com/u/Grayson_Koonce)\
**Post date:** [March 9, 2014, 2:00am UTC](https://forum.ansible.com/t/trigger-restart-of-service-only-when-certain-files-exist/14732/1 "2014-03-09T02:00:24Z")

</div>

Hi there,

I have a playbook that sets up an upstart script for a service that is not immediately deployed to the instance yet. There is a trigger on that call to restart the service, which of course fails because the app files are not there yet. They get deployed later on. Is it possible to trigger a notify of a service ONLY when that service actually exists?

Thanks,

Grayson

---

<div class="post-metadata">

**Author:** ![James\_Martin2](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@James\_Martin2](https://forum.ansible.com/u/James_Martin2)\
**Post date:** [March 10, 2014, 3:29am UTC](https://forum.ansible.com/t/trigger-restart-of-service-only-when-certain-files-exist/14732/2 "2014-03-10T03:29:56Z")

</div>

Why not deploy the service prior to the upstart script? Or why not bundle them into a package? There seems to be something I’m not understanding in the flow of your playbook.

- James
