Practice the vocabulary for describing Ansible playbooks, roles, and task execution in English.
0 / 15 completed
1 / 15
What is an Ansible playbook?
A playbook defines which tasks run on which hosts, in what order. It is the primary unit of configuration in Ansible.
2 / 15
An Ansible task is marked as idempotent. What does this mean?
Idempotency is a core principle in configuration management — tasks should be safe to re-run without causing unintended side effects.
3 / 15
A colleague says we should use an Ansible role for Nginx installation. What does this suggest?
Ansible roles organize tasks, handlers, templates, and variables into a structured directory format for reuse across playbooks.
4 / 15
In an Ansible playbook, a handler is defined. What is a handler?
Handlers are triggered by the notify directive in tasks. They run at the end of the play if notified — common use: restart a service when a config file changes.
5 / 15
The playbook is running in check mode. What does this do?
Check mode (--check) is Ansible's dry run mode, similar to terraform plan — it shows what would change without making changes.
6 / 15
During a code review of an Ansible playbook designed to deploy a web server, Sarah comments: 'This task uses the apt update command. Why is it important that this is idempotent?' Which of the following best explains her concern?
Sarah correctly identifies that idempotency means a task should produce the same result every time it's run, even if executed multiple times. The apt update command doesn't change anything on the server; it just updates the information about available packages. Therefore, running it repeatedly won't cause problems.
7 / 15
You're writing a PR description for an Ansible playbook that configures firewall rules. You want to clearly communicate the purpose of a specific task. Which of the following phrases is most appropriate?
Option 2 provides the most specific and informative description. It clearly states *what* the task does (modifies the configuration) and *how* it does it (using firewall-cmd). The other options are too vague or focus on the tooling rather than the outcome.
8 / 15
During a standup meeting, Mark says, 'I'm using Ansible to deploy new server instances and I'm leveraging variable files to manage configurations.' What does he likely mean by referring to 'variable files'?
Mark is referring to the common practice of using simple text or YAML files to store configurable values that are then used in Ansible playbooks. This allows for easy customization and avoids hardcoding values directly into the playbook, improving maintainability and flexibility.
9 / 15
You receive an API response from an Ansible controller indicating a task failed. The response includes the following message: 'Handler 'restart_nginx' failed with exit code 500.' What does this likely suggest?
An exit code of 500 typically indicates a generic server-side error. This strongly suggests that the `restart_nginx` handler (likely a shell script or Ansible module) encountered a problem while attempting to restart the Nginx service – it didn't complete successfully as intended.
10 / 15
The team is using Ansible to automate server updates. During testing, you run a playbook in 'check mode'. What is the primary effect of this mode?
'Check mode' in Ansible simulates running the playbook without actually making any changes to the target servers. This lets you verify the syntax and logic of your playbooks before deploying them for real. It's a crucial safety measure.
11 / 15
During a code review of an Ansible playbook designed to deploy a web server, Sarah comments: 'This task uses the apt update command. Why is it important that this is idempotent?' Which of the following best explains her concern?
Sarah correctly identifies that idempotency means a task should produce the same result every time it's run, even if executed multiple times. The apt update command doesn't change anything on the server; it just updates the information about available packages. Therefore, running it repeatedly won't cause problems.
12 / 15
You're writing a PR description for an Ansible playbook that configures firewall rules. You want to clearly communicate the purpose of a specific task. Which of the following phrases is most appropriate?
Option 2 provides the most specific and informative description. It clearly states *what* the task does (modifies the configuration) and *how* it does it (using firewall-cmd). The other options are too vague or focus on the tooling rather than the outcome.
13 / 15
During a standup meeting, Mark says, 'I'm using Ansible to deploy new server instances and I'm leveraging variable files to manage configurations.' What does he likely mean by referring to 'variable files'?
Mark is referring to the common practice of using simple text or YAML files to store configurable values that are then used in Ansible playbooks. This allows for easy customization and avoids hardcoding values directly into the playbook, improving maintainability and flexibility.
14 / 15
You receive an API response from an Ansible controller indicating a task failed. The response includes the following message: 'Handler 'restart_nginx' failed with exit code 500.' What does this likely suggest?
An exit code of 500 typically indicates a generic server-side error. This strongly suggests that the `restart_nginx` handler (likely a shell script or Ansible module) encountered a problem while attempting to restart the Nginx service – it didn't complete successfully as intended.
15 / 15
The team is using Ansible to automate server updates. During testing, you run a playbook in 'check mode'. What is the primary effect of this mode?
'Check mode' in Ansible simulates running the playbook without actually making any changes to the target servers. This lets you verify the syntax and logic of your playbooks before deploying them for real. It's a crucial safety measure.
What will I practise in "Ansible Playbook Vocabulary"?
Practice the vocabulary for describing Ansible playbooks, roles, and task execution in English.
How many exercises are in this module?
This module has 15 multiple-choice exercises, each with instant feedback and a full explanation of the correct answer.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to use with no account, sign-up, or paywall.
Do I need to create an account to do these exercises?
No account is required. Just click an option to answer — your score for this session is tracked automatically in the progress bar above.
What happens if I choose the wrong answer?
You'll immediately see which answer was correct, plus a full explanation covering the vocabulary and reasoning behind it — mistakes are where most of the learning happens.
Can I retry the exercises if I want a higher score?
Yes — use the "Try again" button on the results screen to reset and go through all the questions again.
Is my progress saved if I close the page?
No. Progress is tracked only for your current visit; reloading or leaving the page resets the counter. This keeps the exercise simple and account-free.
Where can I find more Infrastructure as Code (IaC) exercises?
Browse the full Infrastructure as Code (IaC) hub for related drills, or check the "Next up" link below to continue with a connected topic.
How is this different from reading an article on the same topic?
Articles explain vocabulary and concepts in prose; this exercise tests and reinforces that vocabulary through active recall with immediate feedback — the two work best together.
Who writes these exercises?
Every exercise is written by the CoderSlingo team, drawing on real workplace English used in IT roles, then reviewed for accuracy and clarity.