Courseiva

EX294 Implement advanced Ansible automation Practice Question

Exhibit

db_password: !vault |\n  $ANSIBLE_VAULT;1.1;AES256\n  65633239636661303062643934383034656661653332313234363166666562356362336638613235\n  3631326331383333616565613737353565386336303231660a666538613337343366346639666337\n  65303334376432343533393338333335393763363034646161333966373730336163386639636335\n  3332376365323932610a323639303336316338616336366232333338353731333434613266306336\n  3766

Refer to the exhibit. An administrator wants to view the decrypted value of 'db_password' without modifying the file. Which command should be used?

⚠ Common exam trap

It's easy for candidates to confuse `ansible-vault view` with `ansible-vault decrypt`, mistakenly thinking they must permanently decrypt the file to see its contents, when `view` provides a read-only decrypted output without altering the file.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

ansible-vault view file.yml

The `ansible-vault view` command decrypts the file in memory and displays its contents to stdout without modifying the encrypted file on disk. This is the correct choice because the administrator only needs to see the decrypted value of 'db_password' and does not want to change the file.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    ansible-vault rekey file.yml

    Why it's wrong here

    ansible-vault rekey changes the vault password protecting the file and rewrites it, neither displaying the decrypted value nor leaving the file unmodified. It is tempting because it operates on vault-encrypted files, and is correct when the existing vault password must be rotated.

  • ✗

    ansible-vault decrypt file.yml

    Why it's wrong here

    ansible-vault decrypt rewrites the file in plaintext on disk, permanently removing encryption, which modifies the file and exposes the secret. It is tempting because it reveals the decrypted value, and would be correct when the file should no longer be vault-encrypted at all.

  • ✓

    ansible-vault view file.yml

    Why this is correct

    ansible-vault view decrypts and displays the file contents to standard output without altering the encrypted file on disk, satisfying the requirement to read db_password without modification. The edit subcommand would decrypt and re-encrypt, risking changes.

  • ✗

    ansible-vault edit file.yml

    Why it's wrong here

    ansible-vault edit opens the file in an editor and writes changes back on save, so it modifies the file rather than merely displaying the decrypted value. It is tempting because it does decrypt content for viewing, and is correct when the administrator genuinely needs to change an encrypted variable.

About these practice questions

This EX294 question is part of Courseiva's 392-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This EX294 practice question is part of Courseiva's free Red Hat certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the EX294 exam.