From 89dd98738b84a8428daf9862f8b99454ae6f5653 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Sun, 22 Oct 2023 00:22:23 +0200 Subject: [PATCH] feat(Initial commit): Add minimal Vagrant configuration and idea --- README.md | 15 +++++++++++++++ Vagrantfile | 25 +++++++++++++++++++++++++ start.sh | 8 ++++++++ 3 files changed, 48 insertions(+) create mode 100644 README.md create mode 100644 Vagrantfile create mode 100755 start.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..df0bc10 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# Homelab + +## TODO +- Write start script +- Write stop script +- Add Makefile for easy control + +## Script +- Detect WSL or Linux +- Detect default network interface +- Inject network interface +- Gather IPs (vagrant ssh-config) +- Deploy Ansible playbook +- Download kubeconfig +- Ping cluster (kubectl get nodes) diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..f548bb8 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,25 @@ +Vagrant.configure("2") do |config| + config.vm.box = "debian/bullseye64" + config.vm.synced_folder '.', '/vagrant', disabled: true + config.vm.provision :shell, path: "https://git.halis.io/athens-school/ISO-repository/raw/branch/master/quick-installer.sh", run: "always" + + config.vm.network "public_network", bridge: "Intel(R) I211 Gigabit Network Connection" + config.vm.provider "virtualbox" do |v| + v.memory = 1024 + v.cpus = 1 + end + + (1..3).each do |i| + config.vm.define "hb-slim-#{i}" + end + + (1..2).each do |i| + config.vm.define "hb-wide-#{i}" do |wide| + wide.vm.provider "virtualbox" do |v| + v.memory = 4096 + v.cpus = 2 + end + end + end + +end diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..1747312 --- /dev/null +++ b/start.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check if running environment is WSL +if [ -f /proc/sys/fs/binfmt_misc/WSLInterop ]; then + bridges=$(VBoxManage.exe list bridgedifs | grep ^Name: -A 11) + + echo $bridges +fi