How to cancel planned handler execution if another handler was notified?

13 views
Skip to first unread message

Nikolay Artamonov

unread,
Mar 17, 2015, 10:07:11 AM3/17/15
to ansible...@googlegroups.com
Hi guys!

Let's assume we have simple playbook:

---
- hosts: server.com
  tasks
:
   
- name: Some task
   
- ...
   
- notify A
   
- name: Some another task
   
- ...
   
- notify B
   
- name: Some another another task
   
- ...
   
- notify B
  handlers
:
   
- name: A
   
- ...
   
- name: B
   
- ...


How can I ensure that handler B will be performed only if A was not notified? In other words, if both A and B were notified then *only* A must be performed. If only B or only A was notified then this handler alone must be performed.

Is it possible to model these requirements in Ansible?

Thanks!

-- 
Truly yours,
Nikolay Artamonov
Reply all
Reply to author
Forward
0 new messages