July 18, 2025
How to Restore a Broken KVM VM from Backup
#
Sometimes things go wrong with virtual machines — maybe a filesystem corruption or a bad update. When that happens, restoring from a backup is your best friend.
Here’s how I restored my broken KVM VM disk image using weekly backups stored on a NAS share.
The situation
#
I have a VM called runner.home.arpa running on KVM, and its disk got corrupted. The VM disk images live at /var/lib/libvirt/images/, and my backups are stored on a NAS mounted at /mnt/backups/runner.home.arpa/.
July 13, 2025
Introduction
#
Setting up Ansible Automation Platform (AAP) manually through the web interface is tedious and highly prone to errors.
I’ve written an Ansible playbook that completely automates the setup of my AAP environment, from credentials and projects to job templates and workflow orchestration. So in case I ever need to rebuild the environment from scratch, all I would need to do is just add the project where that playbook is stored, and add a single template by hand and run it. I’d do it that way because I don’t like running ansible playbooks from the CLI, I always, always use AAP!
July 12, 2025
SSH Hardening and Automation User Setup with Ansible
#
Here’s a little post about how I do SSH hardening for my RHEL9 homelab and how I ensure that the Ansible automation user is properly set. The playbook stems from an incident I had in Red Hat Insights where it was reported that I had an SSH configuration that allowed legacy ciphers. It was also adviced to create a crypto policy that disables weak algorithms.
July 7, 2025
Automated Network Monitoring: Adding Servers to LibreNMS with Ansible
#
Adding servers to LibreNMS by hand is tedious, and should be done by automation. In this post, I’ll show you how I’ve automated the entire process of configuring SNMP and adding servers to LibreNMS using Ansible.
The Workflow
#
Basically what the playbook does is:
- Install and configure SNMP
- Set up necessary firewall rules
- Add the server to LibreNMS
- Add it to the correct device group.
The Playbook
#
Step 1: Installing SNMP Components
#
- name: Ensure snmp is installed
ansible.builtin.dnf:
name:
- net-snmp
- net-snmp-utils
state: present
The net-snmp package is needed for the SNMP daemon.
July 7, 2025
Optimizing KVM Virtual Machines with Tuned Profiles
#
The tuned service on Red Hat-based systems provides pre-configured performance profiles that can significantly improve your VM performance with minimal effort.
In this post, I’ll show you how to optimize your KVM VMs using tuned profiles and automate the entire process with Ansible.
The Playbook
#
Since I manage dozens of VMs in my homelab, doing this manually would be tedious. Instead, I use this Ansible playbook to apply tuned optimization to all my VMs:
July 5, 2025
Automating RHEL Server Updates with Ansible
#
Introduction
#
I hate updating my servers manually so I’ve set up this playbook to run updates. This was probably the first playbook I ever wrote for my home lab, and it’s been running automatically for years now on a weekly schedule every Friday night through AAP (Ansible Automation Platform).
This guide shows you how to automate RHEL (and other yum/dnf based distros like Fedora, CentOS etc.) server updates using Ansible, including proper reboot handling.
July 3, 2025
Automated KVM VM Provisioning with Ansible and OSBuild on RHEL9
#
Introduction
#
When I started looking into automating my homelab VM provisioning, I was surprised by the lack of examples combining Ansible with OSBuild for KVM environments. Not many tutorials focus on KVM, so I wanted something that used Red Hat’s tooling - as I run a RHEL homelab.
I used to provision my homelab virtual machines by hand and eventually I got tired of doing it since I like to tinker around a lot and constantly add new VMs. So, I decided to automate the process using the combination of Ansible and OSBuild.
July 3, 2025
How to setup Ansible Vault
#
Here’s a little guide on how I setup Ansible Vault for my Ansible playbook repository. It’s surprisingly simple and now all of my secrets are encrypted.
Setting Up Ansible Vault
#
1. Create the Directory Structure
#
First, create the standard Ansible directory structure for group variables:
2. Create Your Vault File
#
Create a vault file to store your encrypted credentials:
June 30, 2025
Use ansible-lint with Vault Files
#
Why I wrote this post
#
I decided to write this post because I struggled to find clear, practical examples of how to make ansible-lint work with Ansible Vault files in CI/CD environments. While searching for solutions, I found a GitHub discussion where someone was asking the exact same question I had.
The official ansible-lint documentation mentions that decrypting Ansible Vault in CI is possible, but frustratingly, it doesn’t provide any actual examples of how to implement it. After some trial and error, I figured out a working solution that I want to share.