DEV Community

Cover image for Dealing with binary modules in Ansible Collections
XLAB Steampunk
XLAB Steampunk

Posted on

1

Dealing with binary modules in Ansible Collections

If you pick a random Ansible module and look under its hood, you will almost certainly find Python or PowerShell code there. But Ansible module can be anything that can consume parameters from the standard input, do some work, and report back the status via the standard output.

Binary Ansible modules can prove useful when installing Python packages to the target host is not desired. Because they can statically link their dependencies, there is usually no need for host modification.

But because nothing is free in this world we live in, they have some drawbacks:

  1. Binary Ansible modules are architecture-specific, which means that we need to provide one module per supported architecture.
  2. Statically-linked binaries tend to be massive compared to scripts.

We can get around the first issue by creating a set of action plugins that dispatch the right module for a target architecture. But there is little we can do about the size, which can be problematic in environments with low network speeds. Also, Ansible Galaxy will reject collections larger than 20 Mb, making collection distribution even harder.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay