Ansible Handlers and Notifications Flashcards
6 cards from real Ansible Automation practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 Ansible Handlers and Notifications flashcards as text
A handler is defined with the name 'Restart Nginx'. Which task directive triggers it?
Answer: notify: Restart Nginx
The 'notify' directive with the exact handler name queues that handler for execution at the end of the play if the task changed.
In Ansible roles, where should handler files be placed?
Answer: In the 'handlers/' directory of the role, typically in a file named main.yml
Role handlers are placed in the 'handlers/' directory, with Ansible automatically loading 'handlers/main.yml'.
What happens if a handler is notified but the task that notified it is skipped (not run)?
Answer: The handler is not triggered because a skipped task is not considered changed
Handlers are only triggered when the notifying task actually runs and reports 'changed'. A skipped task never changes, so the handler is not notified.
Which Ansible command-line option allows you to run only the handlers of a playbook without running the tasks?
Answer: There is no such option—handlers can only be triggered by task notifications, not run independently
Ansible does not have a built-in option to run handlers independently. Handlers are always triggered by task notifications.
How can you notify multiple handlers from a single task in Ansible?
Answer: Use 'notify' as a list with multiple handler names
The 'notify' directive accepts a list of handler names, allowing a single task to queue multiple handlers.
What is the scope of handler visibility when working with Ansible roles?
Answer: Handlers defined in a role are globally available to all roles in the play, which can cause naming conflicts
Role handlers are globally scoped within a play, meaning any task in any role can notify them, but this also risks naming conflicts between roles.
How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy
Sources & references
Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy
- redhat.com — Score release, test delivery, renewal, score validity, exam information · verified Oct 2026
- docs.redhat.com — Fees, exam format, retake policy · verified Oct 2026