title: Conditional Notify in Ansible depending on roles
body: <p>Is it possible in Ansible to conditionally notify handlers only if they are present in that play?</p>
  
  <p>For example: I have a playbook for multiple host configurations. Some hosts run PHP with Apache and some with PHP-FPM. Depending upon the host, different handlers need running when PHP is modifued.</p>
  
  <p>This is a simple example of the issue:</p>
  
  <pre><code>- name: copy php.ini
    copy:
      src=roles/php/templates/{{ php_template }}/php.ini
      dest=/etc/
    notify:
      - reload php-fpm
      - reload apache
  </code></pre>
  
  <p>Obviously, what I want to do is notify the correct software to reload when the php.ini file changes. However Ansible gives an error because only one of the handlers is present in the play at any time e.g:</p>
  
  <pre><code>ERROR: change handler (reload php-fpm) is not defined
  </code></pre>
  
  <p>Is there a way to achieve this without creating errors or duplicating Ansible code?<br>
  Thanks in advance</p>