RHCE Ansible Inventory Management Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Thames
T
Thames
Community Contributor
Quizzes Created: 11982 | Total Attempts: 187,298
| Questions: 20 | Updated: Aug 16, 2026
Please wait...
Question 1 / 21
🏆 Rank #-- ▾
0 %
0/100
Score 0/100

1. Which file stores host variables in a directory-based inventory structure?

Explanation

In Ansible, host-specific variables are stored in a directory named `host_vars`, with a file named after the host. Thus, `host_vars/hostname` contains variables that apply to the host named `hostname`.

Submit
Please wait...
About This Quiz
RHCE Ansible Inventory Management Quiz - Quiz

This quiz evaluates your understanding of Ansible inventory management, a core skill for RHCE certification. You will be tested on inventory file formats, host variables, group definitions, dynamic inventory, and inventory plugins. Master these concepts to effectively manage infrastructure automation with Ansible.

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. In inventory, the 'ansible_user' variable specifies the ______ for SSH connections.

Explanation

In an Ansible inventory, `ansible_user` identifies the account Ansible uses when connecting to a managed host over SSH. It specifies the SSH username, not the password, port, or hostname.

Submit

3. What is the purpose of the 'ungrouped' group in Ansible inventory?

Explanation

The `ungrouped` group is Ansible’s default group for hosts listed in an inventory that have not been assigned to any other group. This lets Ansible still target and manage those hosts without requiring a custom group.

Submit

4. How do you enable an inventory plugin in ansible.cfg?

Explanation

The answer key appears inaccurate: inventory plugins are enabled by setting `enable_plugins` in the `[inventory]` section of `ansible.cfg`, with the desired plugin names listed there. A `[plugins]` section is not the standard configuration location for enabling inventory plugins.

Submit

5. Which inventory plugin is commonly used for AWS EC2 instances?

Explanation

The `aws_ec2` plugin is Ansible’s dynamic inventory plugin for discovering and organizing Amazon EC2 instances. It queries AWS and can group hosts using attributes such as tags, regions, and instance details, keeping inventory aligned with the current EC2 environment.

Submit

6. What does the 'hosts: localhost' directive mean in an inventory?

Explanation

In an Ansible inventory, `hosts: localhost` targets the machine running Ansible itself—the control node—rather than any remote host. Tasks assigned to this group therefore run locally on that machine.

Submit

7. In a YAML inventory, how do you define multiple hosts under a group?

Explanation

In YAML, group members are written as a sequence, with each host on a separate line preceded by a hyphen. This format clearly identifies each host as an item in the group’s list.

Submit

8. Which variable specifies the SSH port for a host in inventory?

Explanation

`ansible_port` sets the SSH port Ansible uses to connect to a host defined in the inventory. For example, `web1 ansible_host=192.0.2.10 ansible_port=2222` tells Ansible to connect to `web1` on port 2222 instead of the default SSH port 22.

Submit

9. What is the ansible_host variable used for?

Explanation

In an Ansible inventory, `ansible_host` specifies the actual hostname or IP address Ansible should connect to for a managed host. This lets you use a convenient alias as the inventory name while directing Ansible to a different network address. It does not define the control node, inventory file location, or host’s group.

Submit

10. How do you define group variables in a directory-based inventory?

Explanation

In Ansible, group variables are defined in files or directories under `group_vars/`, named after the inventory group they apply to. For example, `group_vars/webservers` contains variables shared by hosts in the `webservers` group. Ansible loads these variables automatically when processing the inventory.

Submit

11. Which file format is the default for Ansible static inventory?

Explanation

Ansible’s default static inventory format is INI, which uses a simple text-based syntax to list hosts and organize them into groups. Ansible also supports YAML inventories, but INI is the traditional default.

Submit

12. In Ansible, what does the 'all' group represent?

Explanation

The `all` group is an implicit Ansible inventory group that includes every host listed in the inventory, regardless of any other group assignments. It lets you target or apply settings to the entire inventory.

Submit

13. How do you specify a custom inventory file location in an Ansible command?

Explanation

Use the `-i` or `--inventory` option to provide the path to a custom inventory file when running an Ansible command. For example: `ansible all -i ./my_inventory -m ping`.

Submit

14. What is the default location for Ansible inventory file if not specified?

Explanation

Ansible uses `/etc/ansible/hosts` as its default inventory file. This file lists the managed hosts and groups Ansible can target. You can specify a different inventory file in the configuration or with a command-line option.

Submit

15. Which tool can be used to create dynamic inventory from cloud providers?

Explanation

Inventory plugins can query cloud providers’ APIs and build an up-to-date list of hosts and groups at runtime. This avoids maintaining static inventory files and lets Ansible use current cloud resources, such as instances, as targets for automation.

Submit

16. What is dynamic inventory in Ansible?

Explanation

Dynamic inventory retrieves host and group information from external sources, such as cloud providers or databases, when Ansible runs. This lets the inventory reflect current infrastructure without requiring hosts to be listed and maintained manually in a static file.

Submit

17. In YAML inventory format, how do you define a host group with variables?

Explanation

In a YAML inventory, define a host group as a key and place its hosts or variables beneath it using indentation. Colons separate keys from values, while consistent indentation shows the hierarchy.

Submit

18. Which variable type is specific to an individual host in Ansible inventory?

Explanation

Host variables are assigned directly to a specific host in the Ansible inventory, allowing that host to have its own settings, such as a unique IP address, port, or connection user. They apply only to that host, unlike group variables, which are shared among hosts in a group.

Submit

19. What is the purpose of the 'hosts' keyword in an Ansible inventory file?

Explanation

The `hosts` keyword identifies the managed machines Ansible will target. It can contain their hostnames or IP addresses, either directly or through groups, so playbooks can specify which nodes to configure.

Submit

20. In an INI-style inventory, how do you define a group of hosts?

Explanation

In an INI-style inventory, a host group is declared as a section header: write the group name inside square brackets, such as `[group_name]`. List the hosts belonging to that group on the lines below it.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which file stores host variables in a directory-based inventory...
In inventory, the 'ansible_user' variable specifies the ______ for SSH...
What is the purpose of the 'ungrouped' group in Ansible inventory?
How do you enable an inventory plugin in ansible.cfg?
Which inventory plugin is commonly used for AWS EC2 instances?
What does the 'hosts: localhost' directive mean in an inventory?
In a YAML inventory, how do you define multiple hosts under a group?
Which variable specifies the SSH port for a host in inventory?
What is the ansible_host variable used for?
How do you define group variables in a directory-based inventory?
Which file format is the default for Ansible static inventory?
In Ansible, what does the 'all' group represent?
How do you specify a custom inventory file location in an Ansible...
What is the default location for Ansible inventory file if not...
Which tool can be used to create dynamic inventory from cloud...
What is dynamic inventory in Ansible?
In YAML inventory format, how do you define a host group with...
Which variable type is specific to an individual host in Ansible...
What is the purpose of the 'hosts' keyword in an Ansible inventory...
In an INI-style inventory, how do you define a group of hosts?
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!