379 B
379 B
Handlers
Handlers are tasks that only run when notified by other tasks (typically after a change):
- name: Install nginx
hosts: webservers
tasks:
- name: Install nginx
apt:
name: nginx
state: present
notify: Restart nginx
handlers:
- name: Restart nginx
service:
name: nginx
state: restarted