dnf

Fixing curl install failures with Ansible on Red Hat-derivative OSes

Over the past few months, I've noticed some of my automation failing on Red Hat-derivative OSes like Rocky Linux and AlmaLinux. The reason for this has to do with the inclusion of a curl-minimal package in some distros, which conflicts with curl if you try installing the full package.

Unfortunately, the fix for this is a little strange, and so only ends up in Ansible's dnf module, not in the more cross-compatible package module.

The error I was seeing is like:

Updating all your servers with Ansible

From time to time, there's a security patch or other update that's critical to apply ASAP to all your servers. If you use Ansible to automate infrastructure work, then updates are painless—even across dozens, hundreds, or thousands of instances! I've written about this a little bit in the past, in relation to protecting against the shellshock vulnerability, but that was specific to one package.

I have an inventory script that pulls together all the servers I manage for personal projects (including the server running this website), and organizes them by OS, so I can run commands like ansible [os] command. Then that enables me to run commands like: