Ansible galaxy dependency install

Please replace this text with a description of your issue. You should:
Hi,
I am wondering why ansible-galaxy install ignore the requirements file at the repository root
example GitHub - ansible-collections/amazon.aws: Ansible Collection for Amazon AWS

The python module dependencies are not installed by ansible-galaxy. They can be manually installed using pip:

Is there a way to workaround this ?

Also I might be a bit confused, correct me if I’m wrong please :
when you execute a task on a remote host, ansible will need to install itself as well as the module code that will execute the task, how is it supposed to work in such case of external Python dependencies ?

When working on a target (Linux) host, Ansible doesn’t usually “install itself” on target hosts it copies the “module” and the specific Ansible files needed to run, then executes the module via an SSH command, and then deletes the temporary files, with the dependencies of these files deliberately kept as small as possible. This is in part why Ansible can be slower than an agent based system like Puppet where the full agent needs to be installed remotely (since Puppet has everything pre-installed). With Ansible, the bulk of Ansible is still running directly on your local “controller” host.

The common way around it with the AWS modules, since they’re hitting a public API anyway, is to run the modules on the “controller” host (either with connection: local or the local_action module) rather than the remote host and to “manually” install the dependencies into the controller host environment (Or use something like the “Execution Environment” containers where it’s preinstalled).

1 Like