title: Run Ansible handlers based on changed results in multiple loops
body: <p>I have an Ansible variable containing a list of web servers (all on the same host):</p>
  
  <pre><code>servers:
    - foo
    - bar
    - baz
  </code></pre>
  
  <p>And a task that changes their config files, and registers the results in a variable:</p>
  
  <pre><code>- name: create server configs
    template: ...
    with_items: "{{ servers }}"
    notify: restart changed servers
    register: servers_changed
  </code></pre>
  
  <p>And a handler that restarts only the servers that are changed when that task runs:</p>
  
  <pre><code>- name: restart changed servers
    command: restart-my-server {{ item.item.name }}
    when: item.changed
    with_items: "{{ servers_changed.results }}"
  </code></pre>
  
  <p>My problem is, I now need multiple tasks like the one above, which change different config files. But if I do that, they'll overwrite the <code>servers_changed</code> variable, so only the last one will be used.</p>
  
  <p>I could register different variables in each tasks, but then I need a different handler for each one. This would get messy. Is there a better way?</p>