Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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://raw.githubusercontent.com/Bitsonwheels/cloudstack-installer/refs/heads/main/install.sh | bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't hardcode to this repo

```

Here's how you should really run it though:

```bash
curl -o install.sh https://c8k.in/stall.sh
curl -o install.sh https://raw.githubusercontent.com/Bitsonwheels/cloudstack-installer/refs/heads/main/install.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't hardcode to this repo

cat install.sh | more # to read it
bash -x install.sh # to also see what it's doing
```
Expand Down
17 changes: 11 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 apparmor openssh-server sudo wget jq htop tar nmap bridge-utils

# FIXME: check for host spec (min 4-8G RAM?) /dev/kvm and

Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -138,10 +139,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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate here?

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
}

Expand Down Expand Up @@ -222,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
Expand Down