Welcome to the Byte Haven, my homelab setup repository. This repository provides Ansible playbooks to help set up and manage my homelab environment. It uses Ansible to automate server configuration, base setup, and Kubernetes (k3s) installation.
Before you begin, make sure you have the following tools installed:
- 1Password CLI (for retrieving secrets from the vault)
- Ansible
- SSH access to your homelab servers
The setup uses 1Password to retrieve secrets stored in the sg-k8s
vault. You will need to have the following items stored:
- admin-user: The username and initial password for the admin user.
- my_user: The username and password for your primary user.
- k3s-token: Token used for k3s installation.
This task sets up the base configuration for your homelab by retrieving the admin credentials from 1Password and running the Ansible playbook with sudo privileges.
make ansible-first-run
- Retrieves the admin user's initial password and username.
- Executes the
ansible/base.yaml
playbook to configure the server. - Uses SSH keys for secure login, bypassing host key checking for ease of use.
This task runs the base configuration playbook without the admin password setup (useful after the initial run).
make ansible-base
- Executes the
ansible/base.yaml
playbook. - Uses the primary user’s credentials stored in 1Password.
This task installs k3s, a lightweight Kubernetes distribution, on your server.
make ansible-k3s
- Installs any required Ansible collections.
- Retrieves the k3s token from 1Password and installs k3s using the
ansible/k3s-install.yaml
playbook.
-
Clone the Repository
git clone <repository-url> cd <repository-directory>
-
Ensure SSH Access
Make sure you have SSH access to the hosts defined in
ansible/inventory/hosts.yaml
. You may need to adjust your inventory file to point to your homelab servers. -
Configure 1Password CLI
Log in to 1Password CLI to retrieve the necessary credentials:
eval $(op signin)
-
Run the Playbooks
Start with the base configuration:
make ansible-first-run
Afterward, you can re-run tasks like
ansible-base
oransible-k3s
as needed to continue configuring your homelab.
Let me know if you need to tweak this further!