title: How to force handler to run before executing a task in Ansible?
body: <p>I have a playbook which should configure on specified IP, and than connect to this app to configure stuff inside.</p>
  
  <p>I've got a problem: I need to restart app after I've changed anything in app config, and if I do not restart app, connection to it failed (no connection because app knows nothing about new config with new IP address I'm trying to access).</p>
  
  <p>My current playbook:</p>
  
  <pre><code>tasks:
  - name: Configure app
    template: src=app.conf.j2 dest=/etc/app.conf
    notify: restart app
  
  - name: Change data in app
    configure_app: host={{new_ip}} data={{data}}
  
  handlers:
  - name: restart app
    service: name=app state=restarted
  </code></pre>
  
  <p>I need to force the handler to run if <code>configure_app</code> changed before executing 'Change data in app'.</p>