readyforhires

Beginner Ansible test (Beginner)

25 questions · 30 minutes · Free

Inventory, ad-hoc commands and first playbooks.

Take the Beginner Ansible test

What it covers

Interview format

Earn a certificate

The Beginner Ansible test is one of the 8 tests of the DevOps Engineer: Beginner learning path. Pass it and the other 7 tests at 70% or more and readyforhires issues you a verifiable certificate in your name, with its own code and verify link to share or add to LinkedIn.

Sample learning path certificate for DevOps Engineer: Beginner, made out to “Your name” and marked SAMPLE
Pass with 70% or more to earn a verifiable certificate. This is a sample: yours carries your name, the date you earned it and its own verify code.

Sample questions

5 sample questions from the Beginner Ansible test, with the answers. Samples are taken out of the live test, so you will not meet these when you sit it.

  1. What happens when you execute a single module via an ad-hoc command without specifying a subset of hosts?

    1. The module is executed only on the first host in the inventory.
    2. The module is not executed unless a playbook is defined.
    3. The module is executed only on hosts defined in a specific group.
    4. The module is executed on all hosts in the inventory.

    Answer: D. The module is executed on all hosts in the inventory.

    When executing a single module via an ad-hoc command, the module is applied to all hosts defined in the inventory unless a specific subset is defined. This is a core behavior of ad-hoc commands, which are used for quick, one-off tasks without the need for a full playbook.

  2. Which of the following statements correctly describes the output format of the `ping` module when used in an ad-hoc command like `ansible all -m ping`?

    1. The output of `ansible all -m ping` is XML, with a `<ping>` tag and a `<pong>` tag if successful.
    2. The output of `ansible all -m ping` is structured as JSON, with each host showing a `ping` key and a `pong` value if successful.
    3. The output of `ansible all -m ping` is binary data that cannot be parsed as text or JSON.
    4. The output of `ansible all -m ping` is unstructured text, similar to the output of the `shell` module.

    Answer: B. The output of `ansible all -m ping` is structured as JSON, with each host showing a `ping` key and a `pong` value if successful.

    The `ping` module in Ansible returns a structured JSON output, with each host showing a `ping` key and a `pong` value if successful. This is different from the `shell` or `command` modules, which return unstructured text output. The `ping` module is specifically designed to test connectivity and Python availability, and its output is always in JSON format for consistency and ease of parsing.

  3. In the provided inventory file, which of the following is the correct host alias for the machine with the IP address 10.0.0.11?

    1. web[01:03].example.com
    2. prod
    3. 10.0.0.11
    4. web1

    Answer: D. web1

    In the provided inventory example, 'web1' is the host alias for the machine with the IP address 10.0.0.11. Host aliases are used to refer to hosts in playbooks and ad-hoc commands, making it easier to manage and reference hosts without using their IP addresses directly.

  4. You are using the ping module in Ansible to check connectivity to a remote host, but it is not working. What is the most likely reason for this issue?

    1. The ping module is not working because the Ansible version is outdated.
    2. The ping module is not working because the playbook is not properly structured.
    3. The ping module is not working because the inventory file is missing.
    4. The ping module is not working because the target host is unreachable or there is a firewall blocking ICMP traffic.

    Answer: D. The ping module is not working because the target host is unreachable or there is a firewall blocking ICMP traffic.

    The ping module is used to check connectivity between the Ansible control node and the target host. If the ping module is not working, it is typically due to network issues or firewall restrictions preventing ICMP traffic. Other options may suggest unrelated issues, such as incorrect syntax or playbook structure, which are not directly related to the ping module's purpose.

  5. Which of the following correctly describes how to pass parameters to a module in an Ansible ad-hoc command?

    1. The -a flag is used to pass parameters to the module
    2. The -m flag is used to pass parameters to the module
    3. The -v flag is used to pass parameters to the module
    4. The -p flag is used to pass parameters to the module

    Answer: A. The -a flag is used to pass parameters to the module

    In Ansible ad-hoc commands, the -a flag is used to pass arguments to the module being executed. The -m flag specifies the module to use, but parameters are passed using -a. The other options describe incorrect uses of flags or unrelated concepts.

Frequently asked questions

How many questions are in the Beginner Ansible test?
25 questions (15 multiple choice, 10 multi-answer), with 30 minutes to answer them.
What does the Beginner Ansible test cover?
Inventory, Ad-hoc commands, Playbooks, Modules, Variables.
Is the Beginner Ansible test free?
Yes. It is free to take with a readyforhires account.
What level is the Beginner Ansible test?
Beginner, in DevOps & cloud.

More DevOps & cloud tests

Roles that test these skills

Companies that test these skills

All practice tests · All DevOps & cloud tests

Last updated