Collection python dependencies are ignored

Hello,

I created a collection for all my roles for the homelab and defined a requirements.yml for the ansible collections and a requirements.txt for the python packages.
Unfortunately the python package dependencies are ignored during install (collections are ok)

My collection structure:

projects/mcchaos.homelab/
├── README.md
├── docs
├── galaxy.yml
├── meta
│   ├── execution-environment.yml
│   ├── requirements.txt
│   └── runtime.yml
├── plugins
│   ├── README.md
│   ├── filter
│   │   └── my_filters.py
│   └── modules
│       └── proxmox_replication.py
├── requirements.txt
└── roles
    ├── pve_backup
    │   └── tasks
    │       └── main.yml
    ├── restic_pull
    │   ├── tasks
    │   │   └── main.yml
    │   ├── templates
    │   │   └── restic-pull.sh
    │   └── tests
    │       └── test_restic_pull.yml
    └── ...

The execution-environment.yml:

# code: language=yaml
version: 3

dependencies:
  python: meta/requirements.txt

The requirements.txt:

proxmoxer>=2.0
jmespath
requests
httpx
dnspython
netaddr
passlib
ssh-audit
python-debian

Check the dependencies:

$ ansible-builder introspect projects/mcchaos.homelab/
# Dependency data for projects/mcchaos.homelab/
---
python: []
system: []

$ 

Install the collection:

$ ansible-galaxy collection install --force projects/mcchaos.homelab

I tried already several tutorials but unfortunately it’s still not working.
What do I need to configure, that together with the collection all python packages will be installed?

Thanks a lot :slight_smile:
Thomas

The Python requirements are only installed when building an Execution Environment with ansible-builder. ansible-galaxy collection install simply never installs Python requirements.

3 Likes

Thanks for the quick response :slight_smile:

1 Like