DevOps · Flashcard

What is a handler in Ansible?

  • AA task that runs only when another task notifies it of a change
  • BA task that runs first in every play, before the others start
  • CA task that Ansible retries automatically until it succeeds
  • DA task that is skipped unless the play is run with --tags

Why this is the answer

A handler is an ordinary task that sits idle until a task notifies it, and only a changed result does the notifying — which is how a service is restarted exactly when its configuration changed. Running first is pre_tasks, retrying is until with retries, and tag selection is unrelated to notification.

Official docs
Study in Gnoseed →