From cbdaf724ac146cdfcb0056c41ff55d3434ccebcc Mon Sep 17 00:00:00 2001 From: Bitsonwheels <51041273+Bitsonwheels@users.noreply.github.com> Date: Fri, 12 Sep 2025 21:55:10 +0200 Subject: [PATCH 1/6] Update install.sh - Fix local interface detection for /etc/netplan/01-netcfg.yaml creation - Fix System Version Code detection for right apt source creation - Fix GPG key verification - add gpg to install apps --- install.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 027de59..f32e8f0 100644 --- a/install.sh +++ b/install.sh @@ -72,7 +72,7 @@ warn "Work in progress, try again while this is being hacked" ### Setup Prerequisites ### info "Installing dependencies" apt-get update -apt-get install -y openssh-server sudo wget jq htop tar nmap bridge-utils +apt-get install -y gpg openssh-server sudo wget jq htop tar nmap bridge-utils # FIXME: check for host spec (min 4-8G RAM?) /dev/kvm and @@ -84,7 +84,7 @@ setup_bridge() { return fi - interface=$(find /sys/class/net -type l -not -lname '*virtual*' -printf '%f\n' | sort | head -1) + interface=$(ip route get 8.8.8.8 | awk -F"dev " 'NR==1 {split($2,a," ");print a[1]}' | sort | head -1) gateway=$(ip route show 0.0.0.0/0 dev $interface | cut -d ' ' -f 3) hostipandsub=$(ip -4 -br addr show $interface | awk '{ print $3; }' ) info "Setting up bridge on $interface which has IP $hostipandsub and gateway $gateway" @@ -138,10 +138,14 @@ EOF configure_repo() { info "Configuring CloudStack $CS_VERSION repo" + NAME=$(sed -rn 's|^deb\s+\S+\s+(\w+)\s+main.*$|\1|p' /etc/apt/sources.list | head -n 1) + mkdir -p /etc/apt/keyrings + wget -O - https://download.cloudstack.org/release.asc | sudo tee /etc/apt/trusted.gpg.d/cloudstack.asc wget -O- https://download.cloudstack.org/release.asc 2>/dev/null | gpg --dearmor | sudo tee /etc/apt/keyrings/cloudstack.gpg > /dev/null # NOTE: debian-based distro packages are now release agnostic - echo deb [signed-by=/etc/apt/keyrings/cloudstack.gpg] https://download.cloudstack.org/ubuntu noble $CS_VERSION > /etc/apt/sources.list.d/cloudstack.list + echo deb [signed-by=/etc/apt/keyrings/cloudstack.gpg] https://download.cloudstack.org/ubuntu $NAME $CS_VERSION > /etc/apt/sources.list.d/cloudstack.list + apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3D62B837F100E758 apt-get update } From 6daaabb2561cde5fac2afafe9ce06f0d8590fde9 Mon Sep 17 00:00:00 2001 From: Bitsonwheels <51041273+Bitsonwheels@users.noreply.github.com> Date: Fri, 12 Sep 2025 22:05:48 +0200 Subject: [PATCH 2/6] add apparmor to installed apps --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index f32e8f0..9af8df5 100644 --- a/install.sh +++ b/install.sh @@ -72,7 +72,7 @@ warn "Work in progress, try again while this is being hacked" ### Setup Prerequisites ### info "Installing dependencies" apt-get update -apt-get install -y gpg openssh-server sudo wget jq htop tar nmap bridge-utils +apt-get install -y gpg apparmor openssh-server sudo wget jq htop tar nmap bridge-utils # FIXME: check for host spec (min 4-8G RAM?) /dev/kvm and From 020e58b475bff414b827a61eae5955df6fc960b7 Mon Sep 17 00:00:00 2001 From: Bitsonwheels <51041273+Bitsonwheels@users.noreply.github.com> Date: Fri, 12 Sep 2025 22:09:23 +0200 Subject: [PATCH 3/6] change curl urls --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7976fa5..654751f 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,13 @@ NOTE: Work in progress To install and deploy [CloudStack](https://cloudstack.apache.org), just copy and run the following as `root` user: ```bash -curl -sL https://c8k.in/stall.sh | bash +curl -sL https://github.com/Bitsonwheels/cloudstack-installer/blob/main/stall.sh | bash ``` Here's how you should really run it though: ```bash -curl -o install.sh https://c8k.in/stall.sh +curl -o install.sh https://github.com/Bitsonwheels/cloudstack-installer/blob/main/stall.sh cat install.sh | more # to read it bash -x install.sh # to also see what it's doing ``` From 3eacc1d31d8fed4319c697926c3d3ac82f75c826 Mon Sep 17 00:00:00 2001 From: Bitsonwheels <51041273+Bitsonwheels@users.noreply.github.com> Date: Fri, 12 Sep 2025 22:14:24 +0200 Subject: [PATCH 4/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 654751f..58f7529 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,13 @@ NOTE: Work in progress To install and deploy [CloudStack](https://cloudstack.apache.org), just copy and run the following as `root` user: ```bash -curl -sL https://github.com/Bitsonwheels/cloudstack-installer/blob/main/stall.sh | bash +curl -sL https://github.com/Bitsonwheels/cloudstack-installer/blob/main/install.sh | bash ``` Here's how you should really run it though: ```bash -curl -o install.sh https://github.com/Bitsonwheels/cloudstack-installer/blob/main/stall.sh +curl -o install.sh https://github.com/Bitsonwheels/cloudstack-installer/blob/main/install.sh cat install.sh | more # to read it bash -x install.sh # to also see what it's doing ``` From 7344b893c9186a5593494371fdc933e445fe8122 Mon Sep 17 00:00:00 2001 From: Bitsonwheels <51041273+Bitsonwheels@users.noreply.github.com> Date: Fri, 12 Sep 2025 22:55:04 +0200 Subject: [PATCH 5/6] fix "No such file or directory" and apparmor error fix "No such file or directory" and apparmor error --- install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 9af8df5..3867276 100644 --- a/install.sh +++ b/install.sh @@ -116,7 +116,8 @@ EOF # FIX netplan complaining about permissions chmod 600 /etc/netplan/01-netcfg.yaml - + # FIX "No such file or directory" error + mkdir /etc/cloud/ && mkdir /etc/cloud/cloud.cfg.d/ info "Disabling cloud-init netplan config" rm -f /etc/netplan/50-cloud-init.yaml if [[ ! -f "/etc/cloud/cloud.cfg.d/99-disable-network-config.cfg" && ! -f "/etc/cloud/cloud.cfg.d/99_disable-network-config.cfg" ]]; then @@ -226,8 +227,8 @@ configure_host() { # Ubuntu: disable apparmor ln -sf /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/ ln -sf /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper /etc/apparmor.d/disable/ - apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd - apparmor_parser -R /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper + apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd --subdomainfs + apparmor_parser -R /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper --subdomainfs fi if ! kvm-ok; then From 24f808ee8cd1e00682bdc47d079146e51094b37b Mon Sep 17 00:00:00 2001 From: Bitsonwheels <51041273+Bitsonwheels@users.noreply.github.com> Date: Fri, 12 Sep 2025 22:58:17 +0200 Subject: [PATCH 6/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 58f7529..ce28404 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,13 @@ NOTE: Work in progress To install and deploy [CloudStack](https://cloudstack.apache.org), just copy and run the following as `root` user: ```bash -curl -sL https://github.com/Bitsonwheels/cloudstack-installer/blob/main/install.sh | bash +curl -sL https://raw.githubusercontent.com/Bitsonwheels/cloudstack-installer/refs/heads/main/install.sh | bash ``` Here's how you should really run it though: ```bash -curl -o install.sh https://github.com/Bitsonwheels/cloudstack-installer/blob/main/install.sh +curl -o install.sh https://raw.githubusercontent.com/Bitsonwheels/cloudstack-installer/refs/heads/main/install.sh cat install.sh | more # to read it bash -x install.sh # to also see what it's doing ```