-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from GlueOps/feat/refactor
feat: refactor into smaller scripts and added tailscale installation
- Loading branch information
Showing
4 changed files
with
91 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
|
||
#Populate variables to generate /etc/hosts and /etc/network/interfaces files | ||
INTERFACE_PORT=$(ip -br addr | grep 'UP' | grep -v '127.0.0.1' | grep -v '::1/128' | awk '{print $1}') | ||
echo $INTERFACE_PORT | ||
|
||
|
||
INTERFACE_NAME=$(udevadm info -q property /sys/class/net/$INTERFACE_PORT | grep "ID_NET_NAME_PATH=" | cut -d'=' -f2) | ||
IP_CIDR=$(ip addr show $INTERFACE_PORT | grep "inet\b" | awk '{print $2}') | ||
GATEWAY=$(ip route | grep default | awk '{print $3}') | ||
IP_ADDRESS=$(echo "$IP_CIDR" | cut -d'/' -f1) | ||
CIDR=$(echo "$IP_CIDR" | cut -d'/' -f2) | ||
|
||
#Configure the network /ect/network/interfaces and create backup of old one | ||
cat > ~/interfaces << EOF | ||
auto lo | ||
iface lo inet loopback | ||
iface $INTERFACE_NAME inet manual | ||
auto vmbr0 | ||
iface vmbr0 inet static | ||
address $IP_ADDRESS/$CIDR | ||
gateway $GATEWAY | ||
bridge_ports $INTERFACE_NAME | ||
bridge_stp off | ||
bridge_fd 0 | ||
source /etc/network/interfaces.d/* | ||
EOF | ||
|
||
#Add Repository | ||
echo "deb [arch=amd64] http://download.proxmox.com/debian/pve bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list | ||
|
||
#Add repository Key | ||
wget https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg | ||
|
||
#Update system | ||
apt update && apt full-upgrade -y | ||
|
||
#Install Proxmox kernel and reboot | ||
apt install proxmox-default-kernel -y | ||
sysctl -w kernel.panic=10 | ||
reboot now |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Set debconf selections for Postfix | ||
echo "postfix postfix/main_mailer_type select Local only" | debconf-set-selections | ||
echo "postfix postfix/mailname string ''" | debconf-set-selections | ||
|
||
# Install proxmox packages | ||
apt install -y proxmox-ve postfix open-iscsi chrony | ||
|
||
#Reomove the debian kernel and update grub | ||
apt remove linux-image-amd64 'linux-image-6.1*' -y | ||
update-grub | ||
|
||
#remove OS Prober | ||
apt remove os-prober -y | ||
|
||
#If you are not using a license key remove the enterprise repository | ||
rm /etc/apt/sources.list.d/pve-enterprise.list | ||
|
||
#Update the system | ||
apt update && apt dist-upgrade -y | ||
|
||
#Setup a software defined network | ||
apt install libpve-network-perl frr-pythontools dnsmasq -y | ||
systemctl disable --now dnsmasq | ||
|
||
#move the interfaces and back up the old | ||
mv /etc/network/interfaces /etc/network/interfaces.old | ||
mv ~/interfaces /etc/network/interfaces.new | ||
|
||
#Reboot to finalize all the changes | ||
sysctl -w kernel.panic=10 | ||
reboot now |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
read -p "Enter your tailscale auth key: " TAILSCALE_AUTH_KEY | ||
|
||
#Set the software defined network | ||
pvesh create /cluster/sdn/zones -type simple -zone zone0 -dhcp dnsmasq -ipam pve | ||
pvesh create /cluster/sdn/vnets -vnet vnet0 -zone zone0 | ||
pvesh create /cluster/sdn/vnets/vnet0/subnets --subnet 10.0.0.0/16 --type subnet --dhcp-range start-address=10.0.0.50,end-address=10.0.255.254 --gateway 10.0.0.1 --snat 1 | ||
pvesh set /cluster/sdn | ||
|
||
#Set up tailscale | ||
curl -fsSL https://tailscale.com/install.sh | sh | ||
sudo tailscale up --authkey=${TAILSCALE_AUTH_KEY} | ||
sudo tailscale set --ssh |
This file was deleted.
Oops, something went wrong.