readyforhires

Advanced Ansible test (Advanced)

40 questions · 40 minutes · Free

Custom modules, performance and large fleets.

Take the Advanced Ansible test

What it covers

Interview format

Earn a certificate

The Advanced Ansible test is one of the 8 tests of the DevOps Engineer: Advanced 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: Advanced, 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 Advanced Ansible test, with the answers. Samples are taken out of the live test, so you will not meet these when you sit it.

  1. Which strategy should be used in Molecule to ensure that test playbook execution is isolated between scenarios in a realistic project setup?

    1. Use a single virtual machine for all test scenarios to reduce resource usage.
    2. Mount the host OS filesystem directly into the test containers for faster I/O.
    3. Use Docker containers with isolated filesystems and network namespaces for each test scenario.
    4. Reuse the same Docker container across test scenarios without cleaning it between runs.

    Answer: C. Use Docker containers with isolated filesystems and network namespaces for each test scenario.

    Molecule ensures test playbook execution isolation by using Docker containers with isolated filesystems and network namespaces for each scenario. This prevents interference between test runs and ensures consistent, repeatable testing. Other options like reusing the same container without cleaning, using shared filesystems, or relying on host OS isolation are not effective for maintaining isolation in test scenarios.

  2. How does AWX handle the synchronization of credentials from inventory sources?

    1. AWX synchronizes credentials only when a playbook explicitly requests it.
    2. AWX synchronizes credentials continuously in real-time as they change.
    3. AWX synchronizes credentials only when manually triggered by an administrator.
    4. AWX synchronizes credentials periodically based on the configured refresh interval in the inventory source settings.

    Answer: D. AWX synchronizes credentials periodically based on the configured refresh interval in the inventory source settings.

    AWX synchronizes credentials periodically based on the configured refresh interval in the inventory source settings. This allows for controlled updates without overloading the system. Other options are incorrect because they either suggest continuous synchronization (which is not the default behavior), imply manual triggers (which may occur but are not the primary method), or suggest synchronization only on demand (which is not accurate for most configurations).

  3. Which methods are used to return results or report failures in a custom Ansible module?

    1. success and failure
    2. return_json and fail_json
    3. exit_json and fail_json
    4. stdout and stderr

    Answer: C. exit_json and fail_json

    In Ansible, custom modules must use `exit_json` and `fail_json` to return results or report failures. These methods are part of the `AnsibleModule` class and are required for proper communication between the module and Ansible. Other options, such as `stdout` or `stderr`, are not used for this purpose in Ansible modules.

  4. You are experiencing performance issues with Ansible playbooks due to frequent connection failures. Which of the following options best addresses this issue by tuning the connection plugin behavior?

    1. Replace the 'paramiko' connection plugin with the 'winrm' plugin for faster execution.
    2. Modify the 'forks' parameter in the Ansible configuration file to increase parallelism.
    3. Use the 'local' connection plugin to bypass network latency entirely.
    4. Use the 'smart' connection plugin and configure the 'retries' and 'delay' parameters to reduce connection overhead.

    Answer: D. Use the 'smart' connection plugin and configure the 'retries' and 'delay' parameters to reduce connection overhead.

    The 'smart' connection plugin is designed for performance optimization and allows parameters like 'retries' and 'delay' to handle connection failures efficiently. Other options either describe incorrect plugins or do not directly address performance tuning related to connection plugins.

  5. How should extra variables be passed to a job template in AWX to ensure they are correctly interpreted by the playbook?

    1. Use the 'extra_vars' field in the job template and ensure the variables are properly formatted as JSON.
    2. Use the 'custom_vars' field in the job template and ensure the variables are properly formatted as JSON.
    3. Use the 'vars' field in the job template and ensure the variables are properly formatted as JSON.
    4. Use the 'parameters' field in the job template and ensure the variables are properly formatted as JSON.

    Answer: A. Use the 'extra_vars' field in the job template and ensure the variables are properly formatted as JSON.

    In AWX, extra variables for a job template can be passed using the 'extra_vars' field. This field is used to inject variables directly into the playbook run. The variables must be properly formatted as JSON to ensure they are correctly interpreted. If the variables are not correctly formatted or if the 'extra_vars' field is not used, the variables may not be passed to the playbook as intended, leading to errors or unexpected behavior.

Frequently asked questions

How many questions are in the Advanced Ansible test?
40 questions (24 multiple choice, 16 multi-answer), with 40 minutes to answer them.
What does the Advanced Ansible test cover?
Custom modules and plugins, Dynamic inventory, Performance and strategies, Testing with Molecule, AWX and Tower.
Is the Advanced Ansible test free?
Yes. It is free to take with a readyforhires account.
What level is the Advanced Ansible test?
Advanced, 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