EX294 Implement advanced Ansible automation Practice Question
A playbook uses 'vars_prompt' to ask for a confirmation before proceeding with destructive changes. However, when the playbook is run from a CI/CD pipeline, it hangs indefinitely. What is the best way to handle this?
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
✓
Pass the variable via --extra-vars and modify the prompt to be conditional with 'when: variable is not defined'.
Passing the variable via --extra-vars and making the prompt conditional with 'when: variable is not defined' allows the pipeline to provide the variable non-interactively. Option A is unsafe. Option B's --check mode does not solve prompts. Option C is unrelated. Option D encrypts data but does not handle prompts. Therefore, E is best.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Remove the prompt and always proceed.
Why it's wrong here
Incorrect: Removing the prompt removes safety; not a best practice.
- ✗
Set ANSIBLE_STDOUT_CALLBACK=unixy to avoid interactive prompts.
Why it's wrong here
Incorrect: This callback changes output format, does not disable prompts.
- ✗
Encrypt the confirmation in vault and include it.
Why it's wrong here
Incorrect: Vault provides encryption, but the prompt still requires interactive input.
- ✗
Use --check mode to simulate.
Why it's wrong here
Incorrect: --check mode does not execute changes but does not resolve the prompt hang.
- ✓
Pass the variable via --extra-vars and modify the prompt to be conditional with 'when: variable is not defined'.
Why this is correct
Correct: This allows non-interactive input from CI/CD and only prompts when variable is missing.
About these practice questions
Courseiva writes every EX294 question from scratch — 392 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
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.