homelab/ansible/playbooks/setup-k3s.yml
Nik Afiq f33fdc4044 Add initial Ansible configuration and playbooks for homelab setup
- Created ansible.cfg for configuration settings
- Added inventory.yml for host definitions
- Implemented bootstrap playbook for Minisforum setup
- Developed setup playbook for K3s installation
- Defined common role with user and package management tasks
- Established K3s server role with configuration and installation tasks
- Included Traefik Helm values for ingress management
2026-03-05 18:55:41 +09:00

28 lines
772 B
YAML

---
# Run: ansible-playbook -i ansible/inventory.yml ansible/playbooks/setup-k3s.yml
#
# What this does:
# - Installs K3s in server mode (with Traefik disabled)
# - Installs Helm
# - Fetches kubeconfig to /tmp/k3s-minisforum.yaml on your workstation
# - Labels the node as node-role=primary
#
# After this playbook:
# export KUBECONFIG=/tmp/k3s-minisforum.yaml
# kubectl get nodes # should show minisforum as Ready
#
# Then deploy Traefik:
# helm repo add traefik https://helm.traefik.io/traefik
# helm repo update
# helm upgrade --install traefik traefik/traefik \
# --namespace traefik --create-namespace \
# -f values/traefik.yml
- name: Install K3s server
hosts: minisforum
become: true
gather_facts: true
roles:
- k3s-server