Bookmark this page

Quiz: Describing Role Structure

Choose the correct answers to the following questions:

When you have completed the quiz, click check. If you wish to try again, click reset. Click show solution to see all the correct answers.

  1. 1.

    Which one of the following statements best describes roles?

    A

    Configuration settings that allow specific users to run Ansible Playbooks.

    B

    Playbooks for a data center.

    C

    Collections of YAML task files and supporting items arranged in a specific structure.

  2. 2.

    Which role subdirectory contains Jinja2 files that are referenced by role tasks?

    A

    Handlers

    B

    Files

    C

    Templates

    D

    Variables

    E

    Meta

  3. 3.

    How do you use a role in a play so that its role variables and default variables are exposed to the rest of the play?

    A

    Use the pre_tasks keyword.

    B

    Use the post_tasks keyword.

    C

    Use the ansible.builtin.import_role module.

    D

    Use the ansible.builtin.include_role module.

  4. 4.

    Which file in a role's directory hierarchy should contain the default values of variables that might be used as parameters to the role?

    A

    defaults/main.yml

    B

    meta/main.yml

    C

    vars/main.yml

    D

    The host inventory file.

Revision: rh294-9.0-c95c7de