Why can't the supported or custom-built Execution Environment find the modules already installed in it on Ansible Automation Platform?
Environment
- Red Hat® Ansible Automation Platform
Issue
- When using one of the
supportedorcustom-builtExecution Environmentsduring an automation run, why is anerrorreceived about not being able to find amodulethat is present in theExecution Environment?
Resolution
-
Setthe followingparameterwithin yourplaybookor throughhost/extravarssection in theInventoryonAutomation Controller:ansible_python_interpreter: "{{ ansible_playbook_python }}" -
Imagesmay be built upon existingbase imageswhich already includePython.Auto-discoverymay pick up thewrongversion first.
Root Cause
- When using
localhostwith[default]auto python discovery, the system may pick up thewrongpython interpreterdue to having multiple versions within theExecution Environment. By setting theparameteritpointsto thecorrectone and removes theerror.
Diagnostic Steps
-
Check the
Joboutput whichfailswith the below error message:"msg": "<module> is not installed, try 'pip install <module>'"
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments