How I Use Ansible (2025)

As I am nearing 100 commits on one of my Ansible repos, I figured that it would be a good time to share how I use Ansible to configure VPSes, VMs and LXCs at home and in the lab, and at work.

TL;DR: Configuration files and tasks are documented which is helpful for when I configure a service and not look at it for months at a time. Also, regularly committing changes to the roles and playbooks also serves as a log of what I did and sometimes why certain changes made sense at the time.

In the Cloud

The repo in question (codenamed cloud) is a private repo started to deploy TLS certificates. That was 7 years ago. In recent years, the repo now consists of roles and playbooks for a number of VPSes. These roles configured services such as BIND, Apache, nginx, and WireGuard.

Recently, I committed a role to document how I configured Postfix and Dovecot. I got a working configuration years ago, but I do not remember exactly what I did. While I do not plan on using this role, having it (finally) documented will be helpful for if/when I want to rebuild this combination in the future.

At Home and in the Homelab

At home, there is an Ansible repo (codenamed home) that was mainly responsible for maintaining the BIND zones that are used in my home network. Also, it also housed the MariaDB cluster configuration that I looked at once in a while. That repo is due for replacement since my home network has changed.

I also created an lxc-bootstrap playbook to bootstrap LXC containers with the usual configurations and packages.

Home-adjacant, I used Ansible to pre-configure various services and Docker containers in a VM while waiting for the hardware to arrive. See Onsite Stack Ansible Playbook for the details.

In the Wild

Using Ansible with my personal systems put me in a position for being able to use it at work.

One instance of this was to support a service with multiple instances and environments. The playbook ensured that directories had the appropriate user/group ownership and modes. Also, the playbook pushed some wrapper scripts into the right places. With multiple instances and environments, using Ansible made it much easier to ensure that everything is where we expect them to be.

Another instance where I got to use Ansible was for a client project. My teammate had rolled off the project but the client still needed assistance with making updates and onboarding their team such that they can use it from their new infrastructure.

Wrapping it Up

In 2025, I have used Ansible to configure servers in the cloud, VMs/LXCs at home, and at work. It is one of the many tools out there for configuration.