Restoring Custom Virtual Environments After AAP Upgrade
After upgrading AAP, an admin notices that all job templates using a custom virtual environment fail with 'No module named 'foo''. The virtual environment was previously working. What should the admin do first?
Quick Answer
Recreating the custom virtual environment and reinstalling the foo package is correct because of a specific fact about how AAP upgrades handle custom virtual environments: they are not automatically carried forward or migrated by the upgrade process, so a Python environment that worked before the upgrade can be left without its previously installed packages afterward. The error message, No module named foo, is Python reporting that the interpreter it is using can no longer find that package, which directly matches what happens when a virtualenv's installed packages do not survive an upgrade. Because the environment was already working before, the first and most direct fix is to rebuild it and reinstall exactly what it needs, rather than assuming something more complex broke, like the playbook itself or the job template's configuration, since neither of those would produce a Python import error tied to a single missing module. When you see an AAP or Ansible Tower upgrade scenario paired with a job template that previously worked but now fails with a missing module or missing dependency error, think first about whether a custom virtual environment needs to be rebuilt, since upgrades are a known point where these environments can be left behind.
⚠ Common exam trap
Watch out — candidates often assume the custom virtual environment persists unchanged after an upgrade, but Red Hat explicitly tests that custom environments must be recreated and packages reinstalled because the upgrade process does not preserve them.
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
✓
Recreate the custom virtual environment and reinstall the 'foo' package.
After an AAP upgrade, custom virtual environments are not automatically migrated or preserved; they must be recreated and their packages reinstalled. The 'No module named 'foo'' error indicates that the Python environment no longer contains the required package, so recreating the environment and reinstalling 'foo' is the correct first step to restore functionality.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Switch the job template to use an execution environment instead.
Why it's wrong here
This might work but is not the first troubleshooting step; the existing virtual environment should be fixed.
- ✗
Reassign the job template to the default virtual environment.
Why it's wrong here
This would avoid the issue but not fix it; the custom env should still work.
- ✓
Recreate the custom virtual environment and reinstall the 'foo' package.
Why this is correct
Upgrades can break virtual environments; rebuilding them is a standard fix.
- ✗
Verify that the credential associated with the job template is valid.
Why it's wrong here
The error indicates a missing Python module, not authentication.
Go deeper
Related to this question
About these practice questions
One of 520 original EX294 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on EX294
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. An admin wants to use custom Python modules in a job template without affecting the global controller environment. What should be used?
easy- A.Install the modules globally on the controller.
- B.Execution environment with custom collections.
- ✓ C.Create a custom virtual environment and assign it to the job template.
- D.Use a custom credential type that includes Python modules.
Why C: Custom Python modules must be isolated from the global controller environment to avoid conflicts. Ansible Tower/AWX allows you to create a custom virtual environment and assign it to a job template, ensuring that only the modules installed in that environment are used during job execution, leaving the global controller unaffected.
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.