Hi, actually handlers are triggered once at the end of each block of tasks 
in a playbook, even were notified by multiple different tasks. I might be 
wrong, but in your case i don't understand why you need to use when 
statement with handler task.

On Sunday, October 4, 2015 at 4:01:04 PM UTC+3, [email protected] wrote:
>
> HI
> I have a code in my playbook like this : 
>
> *  - name: Copy init scripts*
> *    template: src=file-server.conf.j2  dest=/etc/init/file-server.conf*
> *    register: init_script*
> *    notify: restart file-server*
>
> *- name: Copy env scripts*
> *  template: src=file-server.env.j2  dest=/etc/default/file-server.env*
> *  register: env_script*
> *  notify: restart file-server *
>
> I want to notify the handler  for both tasks in one "handler". I tried : 
>  * - name: restart file-server *
> *    service: name=file-server state=restarted*
> *    when: {{ item}}.changed*
> *    with_items:*
> *       - init_script*
> *       - env_script*
>
> but it doesn't  work!!
> Any ideas ? 
>    
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a62dffca-f395-496e-ade4-6f7515b96cba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to