Why I Migrated to ASDF for Application Management
Jump to the bottom for the gist to use Ansible to easily install asdf and its plugins
What Are Our Options?
Managing tools, primarily CLIs, is a pain in the world of *Nix. The application distribution ecosystem is scattered and fragmented.
I’ve always been striving to reduce the differences between client and server environments (e.g. Ubuntu LTS on my Laptop and also on the server). Installing tools and setting up CI agents is much easier if you have a common method for installing these additional tools.
OS package manager (apt
, yum
, etc)
Installing dependencies with traditional package managers is a solid, tried-and-true way. However, pinning versions, such as with apt-mark hold
, can get a little weird (at least in my experience - as shown below).
But the main problem here is that OS upgrades, such as to a new LTS version even, can be problematic. Just image having a bunch of PHP apps and updating your Ubuntu version. I’d rather not be deeply tied to the operating system for runtime dependencies… as much as possible, at least.
When you work in containers and Dockerfiles, it’ll be more common and less error-prone to pursue this method.
Homebrew / brew
brew
is great because so many projects support it. It’s pretty easy to install and use. But it also sucks because there’s little to no ability to pin or install specific versions of apps. If an updated app breaks for you, like with what would often happen in the earlier days of k9s… then you need an altogether different alternative to install it.- I also often have a good amount of dependency conflicts and issues. Recently I was teaching someone how to install brew on a fresh Ubuntu VM. It failed to install another app because gcc was a dependency, and it provided the
brew install gcc
command as a fix. But that doesn’t fix it. Toapt
we went…
Manual Download and Install
- This is great with apps written in Go because it’s just a single file that you can download and install.
asdf
ASDF is what I’ve discovered recently, and I’m sold. There are a ton of ‘plugins’ which are essentially pointers to installed apps.
Check out the above links to get right to the heart of it to get up and running.
Ansible Play
Here is a little Ansible play that I use to install tools that I use.
Not just useful for your workstation, but also good for tooling on servers. Make small tweaks if you want asdf installed elsewhere.
- Install the requirements in the
requirements.yaml
in this snippet - Use the solid Ansible role, to install asdf and plugins with
install.yaml
. - Add this to your path:
$HOME/.asdf/bin/asdf