← All RHCE Flashcard Decks

Automation and Deployment Flashcards

7 cards from real RHCE practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 7 Automation and Deployment flashcards as text
  1. Which configurations in ansible.cfg are used for privilege escalation?

    Answer: become, become_method, become_user, become_ask_pass

    In Ansible, privilege escalation, often referred to as 'become,' is configured using specific parameters in `ansible.cfg`. These include `become` to enable escalation, `become_method` for the method (e.g., sudo), `become_user` for the target user, and `become_ask_pass` to prompt for a password. These settings collectively define how Ansible gains elevated permissions on managed hosts.

  2. What command syntax is used to perform a syntax check on an Ansible playbook?

    Answer: ansible-playbook --syntax-check playbook.yml

    The command `ansible-playbook --syntax-check playbook.yml` is used to validate the YAML syntax of an Ansible playbook. This command parses the playbook for structural correctness without executing any tasks on target hosts. It is a crucial step for identifying and correcting syntax errors early, preventing potential failures during actual playbook execution.

  3. What command syntax is used to perform a dry run (check mode) of an Ansible playbook without making changes?

    Answer: ansible-playbook -C playbook.yml

    The `ansible-playbook -C playbook.yml` command, where `-C` is shorthand for `--check`, performs a 'dry run' or 'check mode' of an Ansible playbook. In this mode, Ansible reports what changes *would* be made to the target systems without actually implementing them. This is invaluable for testing playbooks and understanding their potential impact before making any permanent modifications.

  4. How do you save the output from an Ansible module to a variable?

    Answer: register: var_name

    In Ansible, the `register` keyword is used to capture the output of a task and store it in a variable. This allows subsequent tasks in the playbook to access and utilize the information returned by the preceding module. For example, the output of a shell command or a module's state can be registered and then used for conditional logic or further processing.

  5. How do you output or display the value of a variable in Ansible?

    Answer: debug: var=var_name

    The `debug` module in Ansible is specifically designed to output variables or messages during playbook execution. Using `debug: var=var_name` will display the current value of the specified variable to the console. This is an essential tool for debugging playbooks, verifying variable contents, and tracing execution flow.

  6. What keyword is used for looping over a list (which can be a variable) in Ansible?

    Answer: loop

    The `loop` keyword in Ansible is used to iterate over lists, dictionaries, or sequences of items within a task. It allows the same task to be executed multiple times, once for each item in the specified list or variable. This significantly simplifies and condenses playbooks when performing repetitive operations on multiple similar entities.

  7. Which Ansible configuration groups are commonly used to define default settings and privilege escalation options?

    Answer: [defaults], [privilege_escalation]

    In the `ansible.cfg` file, the `[defaults]` section is used to define general configuration options that apply globally to Ansible operations. The `[privilege_escalation]` section (or `[become]` in newer versions) is specifically where settings related to privilege escalation, such as `become_method` and `become_user`, are configured. These sections enable centralized management of Ansible's behavior and security settings.

How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy

Sources & references

Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy

  1. redhat.com — Test delivery, renewal, score validity, exam format, score release, exam information · verified Oct 2026