Homelab - New setup
New setup for my homelab
In 2019 I bought a Raspberry PI to run telegram bots, a few scripts, and tools. This was my first experience in managing a Linux “server”!
Later on, I started managing a VPS with a friend of mine, then I started running Docker containers on it to avoid installing programs directly and to avoid the pain of adding PPA repositories. Then I met Kubernetes but I didn’t want to install it on the VPS to keep the VPS management simple and without a lot of overhead (yes, I still use docker-compose).
A few weeks later I got a refurbished mini PC (a sort of a NUC) for free so I decided to use it as a lab to learn and experiment with new technologies!
I actually have the mini PC but I would like to expand the project also for the Raspberry PI 3b+.
Mini PC’s specs:
|CPU||Intel Core i5 8th gen|
|Storage||SSD NVMe 256GB but there’s a free SATA connector for a future HDD/SSD|
The mini PC isn’t too big but I aim to keep this project as cheap as possible so, to have multiple (virtual) hosts, I have to manage VMs. I decided to use Proxmox because it’s free, it exposes REST APIs so it can be scripted using Hashicorp’s tools, like Terraform and Packer.
I could have used ESXi, OpenStack, oVirt, and lots of other solutions but I didn’t want to add too much overhead and worry about things that should just work.
Let’s get started
Okay, I hope you are not bored at this point, yet. Here’s the practical part of the article: Proxmox’s installation
I installed Proxmox manually by connecting the mini PC to a monitor, a keyboard, and the LAN. The installation process is fully guided and documented.
The node has some settings to be configured, so I created an Ansible role for the task.
This role will:
- Upgrade packages
- Disable the power button to avoid accidental power-offs
- Change SSH port to
- Disable swap (required by k3s but can be disabled using
- Set timezone (Default Europe/Rome)
- Set hostname
- Optional: enable automatic security upgrades (enable using
unattended_upgrades: yes, default
You need to disable proxmox’s enterprise repository before running the role.
Docs: Package repositories
Running the role
At this point, we have to setup ansible to run that role:
Make sure you can connect to the proxmox role using SSH.SSH login infoA passwordless authentication is preferred but there’s the possibility to fool ssh and use a password even in non-interactive mode using
sshpass.This is a tip
You can import your public keys from your GitLab or GitHub account by using curl:
curl https://gitlab.com/FedericoAntoniazzi.keys > .ssh/authorized_keys
Clone my collection into your ansible collection directory
site.ymlfile with the following content
- Define hosts in the
- Run the playbook
This project is just at its beginning and there are lots of ideas that I will share here.
Thank you for taking the time to read this post and feel free to contact me on Telegram, Matrix, LinkedIn, and so on… (links in the homepage) 😃