This is an automated archive made by the Lemmit Bot.
The original was posted on /r/selfhosted by /u/marwanblgddb on 2025-01-26 21:22:23+00:00.
Hello everyone !
I am excited to share what I have been working on the last months.
I have been homelabing and selfhosting the many years now, and I decided to re-re-re-re-re-do my homelab, but this time using IaC.
Since I have settled for Proxmox and I decided to continue with Docker, I decided to use Ansible. It wasn’t the best as the documentation is not super clear, however I created a collections of playbooks that I am happy to use now.
The repository:
You can find all the code I use at the following link :
This is the initial commit, and the past 2 days, creating some information and sanitizing the files, I found out that many things needs some changes. So expect to see modifications to names, variables (not much the names), and other improvements.
How it works:
I have a raspberry pi that I use to run the playbooks from. Most of the playbooks I saw were to be run directly on the node. Also I started saving sensitive information on Hashicorp vault instead of the Ansible Vault. I like the fact that there’s a UI for it, and it allowed me to learn a bit about it.
You can copy the repository or tasks you need. Some of the tasks, specially creating users, needs you to create ssh keys on the machine you are running the playbook from. Set the location in the vault/vars file and test if it works.
I am working on making it more clear how each variable is defined and used in each role.
Specially I am going to focus to make sure the playbooks works if it’s a single proxmox node, or a cluster without making too many modifications.
Docker
If, like me, you still use docker in a virtual machine (or on bare metal) and want to use docker-compose.yml files, well the different roles achieve that.
I created the roles to accomodate how I wanted to define the containers.
Basically, each docker-compose.yml
file is set under the host_vars and that means you want to deploy the container in that specific host. Running the roles will deploy or redeploy the container as needed, copy the configurations files saved in files/containers/container_name
Meaning you can update the configuration for homepage, traefik without ssh to the machine.
I know some people use CI/CD tools. I’m not planning do to that yet and so far this has been a good way to manage that.
Please provide any feedback, anything that may not work as needed, I’ll try to acomodate.
I would like to specially thank feu TTECK, as I started writing bashscripts after reading theirs to manage proxmox, then decided to move to Ansible. Really amazing work ! Also I would like to thank the owner of this repository : I have learned a lot about how Ansible works reading this. I created my role to create a cluster because I managed to understand how it works reading their code. Also thank you to everyone else that contributes to the community.