My Ansible Role for Nerd Fonts

Installing Nerd Fonts is easy in Arch Linux: they are in the official repositories. That’s not true for Ubuntu and Fedora. Of course, installing them in these distributions is also not complicated. Still, it is a manual procedure: download the font archive, extract it in a specific directory, and regenerate the font cache.

That sounds like an automation task for Ansible!

I created an Ansible role to install my favorite Nerd Fonts in Ubuntu and Fedora: https://github.com/LorenzoBettini/my_nerd_fonts_role.

You can find the instructions for using such a role in your Ansible playbooks.

Here, I briefly describe the main parts.

The file “tasks/download-font.yml” defines the tasks for downloading and extracting the zip archive after creating the destination directory:

The “tasks/main.yml” uses the above tasks, iterating through all the specified fonts to install. It also ensures that some packages are installed:

The variable “fonts_to_install” contains the list of font names to install based on the ZIP archives to download from the Nerd Fonts release site.

The file “vars/main.yml” contains my list of fonts to install:

That’s all: I use this role in my playbooks, and it installs all the Nerd Fonts I like best.

Enjoy your Nerd Fonts! 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.