Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ushiradineth/homelab
Automated Homelab configuration using NixOS and Ansible
https://github.com/ushiradineth/homelab
ansible docker homelab kuberenetes nixos
Last synced: 9 days ago
JSON representation
Automated Homelab configuration using NixOS and Ansible
- Host: GitHub
- URL: https://github.com/ushiradineth/homelab
- Owner: ushiradineth
- Created: 2024-07-29T02:59:10.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-10-04T21:23:44.000Z (about 1 month ago)
- Last Synced: 2024-10-11T23:22:40.035Z (about 1 month ago)
- Topics: ansible, docker, homelab, kuberenetes, nixos
- Language: Jinja
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐งช Homelab Configuration
- This repository consists of code that helps me boot up my 'home server' from scratch with a few simple commands.
- My motivation for this is due to my old laptop failing beyond repair at times which requires me to restart configuration from the beginning.## ๐ง Stack
- NixOS
- Ansible
- Docker
- Kubernetes## ๐ Docker Services
- [x] Portainer (Docker UI)
- [x] Uptime Kuma
- [x] Observability for system and network. (Prometheus, Grafana, Node Exporter)
- [x] Crafty (Minecraft Server)
- [x] Ngrok (TCP Tunnels)
- [ ] Tailscale or Wireguard (VPN)
- [x] NextCloud (Network Drive with Google Drive like UI)
- [ ] Adguard (Local DNS + DHCP Server)
- [ ] Homer (Dashboard)
- [x] KASM (Desktop as a Service)## ๐๏ธ Kubernetes Services
- [ ] CertManager
- [ ] Traefik
- [ ] Zalando (PostgreSQL Cluster)
- [ ] Knative
- [ ] Observability Stack## ๐ Ansible Documentation
### ๐ Playbooks
- nixos
- Purpose: To generate and build the NixOS configuration.
- Command: `ansible-playbook -i user@host, nixos.yml --ask-become-pass`
- Note: --ask-become-pass is required as this playbook needs to build and update the OS.- dotfiles
- Purpose: To pull and stow dotfiles.
- Command: `ansible-playbook -i user@host, dotfiles.yml --ask-become-pass`
- Note: --ask-become-pass is required as this playbook creates the dotfiles for the root user aswell.- docker
- Purpose: To create docker configuration and deploy the services.
- Command: `ansible-playbook -i user@host, docker.yml`
- Note:
- This playbook will create a .env file and return early if the .env file is not found on the remote machine, ensure that this is filled as needed.
- This playbook will not restart services when environment variables change as this does not keep track of them, restart the services manually if the environment variables do change.### ๐ท Roles
- ssh_port
- Check if the default SSH port is changed to a custom one.
- Set the SSH Port to the port which the script can connect to successfully.
- Throw an error if both default and custom SSH ports fails.- nixos
- Generate configuration.nix file with the variables.
- Build and switch to the new configuration if the configuration.nix file is changed.- dotfiles
- Clone or Pull the dotfiles repository into the given directory.
- Stow the files if the dotfiles are changed.- docker
- Copy the compose file from the local directory to the remote directory.
- Deploy the service(s) defined in the compose file.## NixOS Installation Flow
- Download the latest NixOS Minimal ISO from the [NixOS website](https://nixos.org/download/).
- Create a bootable USB drive with the ISO file using a tool like [Balena Etcher](https://etcher.balena.io/).
- Follow the instructions on the [NixOS website](https://nixos.org/manual/nixos/stable/#sec-installation).
- Edit the configuration.nix file to have the following changes:
- `services.openssh.settings.PermitRootLogin = "yes"`
- Add `python3` to the `environment.systemPackages` list.
- Run `nixos-rebuild switch` to update the configuration.
- Run `ansible-playbook -i root@ip, nixos.yml --ask-pass --ask-become-pass`
- Reboot the system.