1. B
The inventory file is used to define and organize the managed hosts and groups that Ansible will automate. It can be in INI or YAML format and specifies which systems Ansible should manage, along with variables and groupings for better organization and targeting of automation tasks.
2. B
The yum package manager module is specifically designed for managing packages on Red Hat-based systems like RHEL, CentOS, and Fedora. While the generic package module can work across different systems, yum is the correct choice when specifically working with Red Hat family distributions that use the yum package manager.
3. C
In Ansible, variables are referenced using the Jinja2 templating syntax with double curly braces surrounding the variable name. This allows Ansible to substitute the variable value during playbook execution. This syntax is consistent throughout playbooks, templates, and other Ansible files where variable substitution is needed.
4. B
The view command allows you to view the contents of an encrypted file temporarily without permanently decrypting it. This is useful for checking encrypted data without compromising security by leaving decrypted files on disk, maintaining the security posture while allowing necessary access to information.
5. B
Idempotency in Ansible means that running the same task multiple times will produce the same result without causing unintended side effects. This is a core principle that ensures playbooks can be run repeatedly safely, making changes only when necessary and not causing duplicate or conflicting configurations.
6. C
The hosts section in an Ansible playbook defines which hosts or groups from the inventory file should be targeted for the tasks in that play. This can be a specific host, a group name, or patterns to match multiple hosts, providing flexibility in targeting automation tasks.
7. B
The notify directive triggers handler execution when a task makes a change to the system. Handlers are special tasks that run only when notified, typically used for actions like restarting services after configuration changes, ensuring efficient execution by only performing actions when needed.
8. B
Handlers are special tasks in Ansible that only execute when explicitly notified by other tasks. They are commonly used for actions that should only occur when changes are made, such as restarting a service after its configuration file has been modified, preventing unnecessary service disruptions.
9. B
The file module is used to manage files, directories, symlinks, and their properties in Ansible. It can create, delete, or modify permissions and ownership of filesystem objects on managed hosts, providing comprehensive file system management capabilities for automation.
10. C
Secure Shell protocol is the default protocol Ansible uses to communicate with Linux and Unix hosts. It provides secure, encrypted communication and does not require any agent installation on managed nodes, making it efficient, secure, and easy to implement across infrastructure.
11. B
The become directive with yes value is used to specify privilege escalation in Ansible playbooks. When set to yes, Ansible will attempt to execute tasks with elevated privileges, typically using sudo or su on Linux systems, allowing tasks that require administrative permissions.
12. B
The template module uses Jinja2 templating to generate configuration files dynamically. It allows you to create files on managed hosts with variable substitution, conditional logic, and loops, making configuration management flexible and powerful for diverse infrastructure needs.
13. B
Roles in Ansible provide a way to organize and reuse automation content in a structured, standardized directory layout. They encapsulate tasks, variables, files, templates, and handlers into reusable components that can be shared across projects, promoting code reusability and maintainability.
14. B
The syntax-check flag validates the syntax of a playbook without executing any tasks. This helps catch errors before running the playbook against production systems, allowing developers to identify and fix issues early in the development process.
15. B
The register keyword captures the output of a task and stores it in a variable for later use. This allows you to make decisions or perform actions based on the results of previous tasks, enabling dynamic and conditional automation workflows.
16. C
The shell module executes commands through a shell on the remote host, allowing the use of shell features like pipes, redirects, and environment variables. It provides more flexibility than the command module but with slightly less security due to shell interpretation.
17. B
The shell module supports shell features like pipes, redirects, and environment variables because it runs commands through a shell interpreter. The command module executes commands directly without shell processing, making it more secure but less flexible for complex command operations.
18. B
Default variables for an Ansible role are defined in the defaults directory within the role structure. These variables have the lowest precedence and can be easily overridden by other variable definitions, allowing flexible configuration management across different environments.
19. B
The when conditional in Ansible controls whether a task executes based on specified conditions. It evaluates expressions and only runs the task if the condition is true, enabling dynamic and flexible playbook behavior based on runtime conditions or system state.
20. C
The service module provides a unified interface for managing system services across different init systems like systemd, upstart, and SysV init. It can start, stop, restart, and enable services at boot, abstracting the differences between various service management systems.
21. B
The gather_facts directive instructs Ansible to collect system information from managed hosts before executing tasks. This information includes operating system type, IP addresses, hardware details, and other useful data that can be used in playbooks through variables for conditional logic.
22. B
The include_vars module loads variables from external YAML or JSON files into the playbook during execution. This allows for better organization and separation of variable definitions from playbook logic, promoting cleaner code structure and easier maintenance.
23. B
The mysql_db module is specifically designed to manage MySQL and MariaDB databases in Ansible. It can create, drop, import, and export databases on MySQL-compatible database servers, providing comprehensive database management capabilities for automation.
24. B
The delegate_to directive executes a task on a different host than the one currently being processed. This is useful for scenarios like updating a load balancer when deploying to web servers or performing orchestration tasks that need to affect different systems.
25. B
The serial keyword controls how many hosts are processed simultaneously during playbook execution. This is useful for rolling updates where you want to update a subset of hosts at a time rather than all at once, minimizing service disruption during deployments.
26. B
The user module manages user accounts on managed hosts. It can create, modify, and delete users, as well as manage user properties like home directories, shells, groups, and SSH keys, providing comprehensive user account management for system administration.
27. B
The set_fact module creates or modifies variables during playbook execution. Unlike variables defined statically, set_fact allows you to compute and store values dynamically based on task results or conditions, enabling flexible runtime variable manipulation.
28. B
The loop construct in Ansible allows you to iterate over a list of items and execute a task for each item. It is the modern replacement for the older with_items syntax and provides more flexibility and better performance for iteration operations.
29. C
The uri module is used to interact with web services and APIs by making HTTP requests. It supports various HTTP methods like GET, POST, PUT, and DELETE, and can handle authentication and SSL verification, making it ideal for API integration.
30. B
Tags in Ansible allow you to selectively execute specific tasks or roles within a playbook. You can use the tags option when running a playbook to run only tasks with specific tags, useful for testing or partial deployments without running entire playbooks.
31. B
The ping module tests basic connectivity to hosts. Despite its name, it does not use ICMP ping but instead verifies that Ansible can connect via SSH and execute Python on the target hosts, confirming the complete communication pathway.
32. B
The ignore_errors directive allows playbook execution to continue even if a task fails. This is useful for tasks where failure is acceptable or expected, though it should be used carefully to avoid masking real problems that need attention.
Physicians and advanced practitioners broadening their clinical knowledge base often cross-reference their preparation with the nclex practice test, which covers pharmacology, pathophysiology, and patient management principles relevant across medical disciplines.
Emergency medical providers preparing for advanced certifications often reinforce their foundational clinical knowledge with the nclex practice test, which covers pharmacology, patient assessment, and emergency intervention protocols applicable to prehospital and hospital care.
Pharmacists pursuing specialty board certification often benchmark their clinical knowledge using the Pharmacy Technician Practice Test 2026, which covers drug classifications, dispensing regulations, and patient counseling principles foundational to all pharmacy practice settings.
Transportation and infrastructure professionals seeking federal and state compliance credentials may also explore the MSHA Practice Test 2026, which covers federal safety regulations and hazard recognition procedures relevant to heavy construction and transportation worksites.
Prepare for the Ansible Automation exam with our free practice test modules. Each quiz covers key topics to help you pass on your first try.