Collections inside of the
galaxy entry of an execution environment
will contribute their Python and system requirements to the image.
Requirements from a collection can be recognized in these ways:
meta/execution-environment.ymlreferences the Python and/or bindep requirements files
A file named
requirements.txtis in the root level of the collection
A file named
bindep.txtis in the root level of the collection
If any of these files are in the
build_ignore of the collection, it
will not work correctly.
Collection maintainers can verify that
the requirements they expect by using the
introspect command. Example:
ansible-builder introspect --sanitize ~/.ansible/collections/
--sanitize option will go through all of the collection requirements and
remove duplicates, as well as remove some Python requirements that should normally
be excluded (see Python Dependencies below).
-v3 option to
introspect to see logging messages about requirements
that are being excluded.
Python requirements files are combined into a single file using the
requirements-parser library in order to support complex syntax like
references to other files.
Entries from separate collections that give the same package name will be combined into the same entry, with the constraints combined.
There are several package names which are specifically ignored by
ansible-builder, meaning that if a collection lists these, they will
not be included in the combined file. These include test packages and
packages that provide Ansible itself. The full list can be found in
EXCLUDE_REQUIREMENTS in the
Any requirements supplied in the user requirements file, via the
option to the
introspect command, will not be processed against the list of
excluded Python packages.
bindep format provides a way of specifying cross-platform
requirements. A minimum expectation is that collections specify
necessary requirements for
Entries from multiple collections will be combined into a single file. Only requirements with no profiles (runtime requirements) will be installed to the image. Entries from multiple collections which are outright duplicates of each other may be consolidated in the combined file.