Thanks Ian, I was missing python3-lxml, so added it to bindep.txt and that EE now works. I kept adding it and validating it via pip, which obviously doesn't work. That's some reading I'll have to do to understand that difference.
So for anyone else's benefit who might run into this, this is what my EE build looks like.
execution-environment:
---
version: 3
build_arg_defaults:
ANSIBLE_GALAXY_CLI_COLLECTION_OPTS: '--pre'
images:
base_image:
name: registry.redhat.io/ansible-automation-platform-25/ee-minimal-rhel8@sha256:7d2df3be0924c78258d974dde537b0a1654e1c4abbcc5f86916502eb89cb7949
dependencies:
galaxy: requirements.yml
python:
- six
- pyds8k
- pip
- requests
- jmespath
system: bindep.txt
options:
package_manager_path: /usr/bin/microdnf
additional_build_steps:
prepend_base:
- RUN echo This is a prepend base command!
prepend_galaxy:
# Environment variables used for Galaxy client configurations
- ENV ANSIBLE_GALAXY_DISABLE_GPG_VERIFY=1
- ENV ANSIBLE_GALAXY_SERVER_LIST=galaxy
- ENV ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_URL=https://*************/pulp_ansible/galaxy/rh-certified/
- ARG ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN=*********************************
- ENV ANSIBLE_GALAXY_SERVER_GALAXY_URL=https://galaxy.ansible.com/
prepend_final:
- RUN whoami
- RUN cat /etc/os-release
append_final:
- RUN echo This is a post-install command!
- RUN ls -la /etc
- RUN microdnf upgrade
Then in bindep.txt:
gcc
python3-devel
python3-psutil
python3-pip
libxml2-devel
libxslt-devel
python3-lxml
python3-requests
python3-jmespath
And finally my requirements.txt:
---
collections:
- name: ibm.power_hmc
- name: ibm.power_aix
- name: markuman.nextcloud
- name: ibm.spectrum_virtualize
- name: ibm.ds8000
- name: brocade.fos
- name: community.general
Thanks again for all the help and insights.
6/16/25 - I've made some additional changes and additions of further requirements I found for some of the IBM collections. What was causing me so much confusion, is that by default, Ansible does not use /usr/bin/python3 as the interpreter in a EE, so those PIP installed packages aren't found. It's using /usr/libexec/platform-python-3*. Here's some details on that.
https://www.reddit.com/r/ansible/comments/rb80pv/execution_environments_and_pip_module_locations/
------------------------------
Mark Steele
Guru
Direct Systems Support
San Diego CA
------------------------------
Original Message:
Sent: Wed June 11, 2025 05:10 AM
From: Ian Bellinfantie
Subject: ibm.power_hmc complaining about missing lxml from AAP 2.5
Hi Mark
I include it in my bindep.txt
libxml2-devel
libxslt-devel
python3-devel
gcc
python3-lxml
Regards
Ian
------------------------------
Ian Bellinfantie
Original Message:
Sent: Tue June 10, 2025 08:46 PM
From: Mark Steele
Subject: ibm.power_hmc complaining about missing lxml from AAP 2.5
Could use your all's help again, pretty please. Can't seem to figure this out.
Simple play, works fine when run with ansible-playbook:
---
- name: Grab the WWN's of the LPARs on a HMC
hosts: dsshmcs
connection: local
gather_facts: false
- name: Capture LPAR Data
ibm.power_hmc.powervm_lpar_instance:
hmc_host: "{{ src_hmc }}"
hmc_auth: "{{ hmc_auth }}"
system_name: "{{ src_system_name }}"
vm_name: "{{ lpar_name }}"
state: facts
advanced_info: true
register: lpar_info
connection: local
When running the same playbook from AAP 2.5, using a custom execution environment, it complains about missing lxml. Yes, the execution environment includes lxml and I've tried lxml at version 4.9.2 and 5.4.0. I went and added some more troubleshooting items into my playbook, that clearly show me that lxml exists:
tasks:
- name: Run a PIP3 command
ansible.builtin.pip:
name: lxml
state: present
executable: pip3
- name: List all PIP3 packages
ansible.builtin.command: pip3 list
register: pip_list
changed_when: pip_list.rc != 0
- name: Show PIP3 packages
ansible.builtin.debug:
msg: "{{ pip_list.stdout_lines }}"
- name: Capture LPAR Data
ibm.power_hmc.powervm_lpar_instance:
hmc_host: "{{ src_hmc }}"
hmc_auth: "{{ hmc_auth }}"
system_name: "{{ src_system_name }}"
vm_name: "{{ lpar_name }}"
state: facts
advanced_info: true
register: lpar_info
connection: local
And still, it complains:
Requirement already satisfied: lxml in /usr/local/lib64/python3.11/site-packages (5.4.0)
msg: - Package Version - '------------------------- ---------'... - lockfile 0.12.2 - lxml 5.4.0 - MarkupSafe 2.1.5
..._ansible_verbose_always: true_ansible_no_log: falsechanged: false
msg: 'Error: Missing prerequisite lxml package. Hint pip install lxml'invocation: module_args:
Running out of things to try. Any guidance is certainly appreciated.
------------------------------
Mark Steele
Guru
Direct Systems Support
San Diego CA
------------------------------