EX294 Manage inventories and credentials Practice Question
An administrator wants to create a custom credential type to store a third-party API key. The API key must be passed to the playbook as an environment variable `MY_API_KEY`. What is the correct Injector configuration in the custom credential type definition?
⚠ Common exam trap
Many exam-takers confuse `env` with `extra_vars` or forget the Jinja2 templating syntax, leading them to pick Option B (missing braces) or Option C (incorrect injector type).
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
✓
env: {MY_API_KEY: "{{ api_key }}"}
The Injector configuration for a custom credential type in Ansible Automation Platform uses the `env` key to map credential inputs to environment variables. The syntax `env: {"MY_API_KEY": "{{ api_key }}"}` correctly references the input field `api_key` using Jinja2 templating and assigns it to the environment variable `MY_API_KEY`, which the playbook can then access via `ansible_env.MY_API_KEY`.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
file: {MY_API_KEY: "{{ api_key }}"}
Why it's wrong here
file expects a path, not a simple mapping.
- ✗
env: {"MY_API_KEY": api_key}
Why it's wrong here
The value must be a Jinja2 template string.
- ✗
extra_vars: {MY_API_KEY: "{{ api_key }}"}
Why it's wrong here
extra_vars sets Ansible variables, not environment variables.
- ✓
env: {MY_API_KEY: "{{ api_key }}"}
Why this is correct
The env dictionary maps credential inputs to environment variables.
Go deeper
Related to this question
About these practice questions
This EX294 question is part of Courseiva's 520-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 →
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.