Hi, don’t worry, you’re on the right way
From your Ansible Builder output, the line that should be noted is here:
#22 5.236 error: command 'gcc' failed: No such file or directory
Since the base image you’ve specified (quay.io/centos/centos:stream9-minimal
) does not contain gcc
, so Python has failed to build it, now it’s time to add gcc
to dependencies.system
However, if we continue on this way we’re on, I believe we will repeatedly solve one problem and then the next problem will appear. This is because stream9-minimal
is really a minimal package installed, and there will probably be more things missing in the future.
So, I propose a slightly different approach. How about customizing based on a generic execution-environment.yml
that is already working widely for AWX?
Specifically, how about customizing this file for use? This is the default EE image for AWX, which supports multiple connection methods, including Windows and network devices as well as Linux.
From our previous correspondence, I have read that your requirements are as follows
- Requires collections:
servicenow.itsm
,community.general
,community.network
,ansible.windows
- No warnings for
ansible.windows
- Ansible 2.14+
- Python 3.9+ (it does not necessarily have to be 3.11)
As an example, based on the above file, I modified it to meet your requirements. Also added the comments why I modified so. It may include packages and modules that you don’t need, but I believe you will have less trouble.
---
version: 3
# Not modified: Keep base_image as-is since stream9 has basic packages including Python 3.9
images:
base_image:
name: quay.io/centos/centos:stream9
dependencies:
# Not modified: Keep ansible_core as-is to install Ansible 2.15.x
ansible_core:
package_pip: ansible-core>=2.15.0rc2,<2.16
# Not modified: Keep ansible_runner as-is to install latest ansible-runner
ansible_runner:
package_pip: ansible-runner
# Modified: Commented unrequired collections out, added required collections
galaxy: |
---
collections:
# - name: awx.awx
# - name: azure.azcollection
# - name: amazon.aws
# - name: theforeman.foreman
# - name: google.cloud
# - name: openstack.cloud
# - name: community.vmware
# - name: ovirt.ovirt
# - name: kubernetes.core
- name: ansible.posix
- name: ansible.windows
# - name: redhatinsights.insights
- name: servicenow.itsm
- name: community.general
- name: community.network
# Modified: Commented unrequired packages that is not required for most use-cases
system: |
git-core [platform:rpm]
python3.9-devel [platform:rpm compile]
libcurl-devel [platform:rpm compile]
krb5-devel [platform:rpm compile]
krb5-workstation [platform:rpm]
# subversion [platform:rpm]
# subversion [platform:dpkg]
git-lfs [platform:rpm]
sshpass [platform:rpm]
rsync [platform:rpm]
epel-release [platform:rpm]
python-unversioned-command [platform:rpm]
unzip [platform:rpm]
# podman-remote [platform:rpm]
# Modified: Commented unrequired modules that is not required for most use-cases
# and added modules from your `requirements.txt`
python: |
git+https://github.com/ansible/ansible-sign
ncclient
paramiko
pykerberos
pyOpenSSL
pypsrp[kerberos,credssp]
pywinrm[kerberos,credssp]
toml
pexpect>=4.5
python-daemon
pyyaml
six
# receptorctl
objectpath
netaddr==0.10.1
additional_build_steps:
# Not modified
append_base:
- RUN $PYCMD -m pip install -U pip
# Modified: Comment receptor-related lines out since these are required only for control plane EE
append_final:
# - COPY --from=quay.io/ansible/receptor:devel /usr/bin/receptor /usr/bin/receptor
# - RUN mkdir -p /var/run/receptor
- RUN git lfs install --system