Skip to content

Instantly share code, notes, and snippets.

@zet4
Last active January 31, 2018 16:02
Show Gist options
  • Save zet4/4d382677c13c819e01c5dc6018b44f55 to your computer and use it in GitHub Desktop.
Save zet4/4d382677c13c819e01c5dc6018b44f55 to your computer and use it in GitHub Desktop.
#cloud-config
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJRKWPGyfCoJNsDAQ0j1IeUyP7V+zzojuvT4sl4SicQ8
rancher:
state:
autoformat:
- /dev/sda
- /dev/sdb
#!/usr/bin/env bash
## Generates a password for the kernel cmdline
password=$( cat /dev/urandom| tr -dc a-zA-Z0-9 | fold -w 20 | head -n 1 )
echo "## Installing kexec-tools, aria2" && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --show-progress kexec-tools aria2 && \
apt-get clean
echo "## Downloading RancherOS ISO" && \
aria2c https://github.com/rancher/os/releases/download/v1.2.0-rc2/rancheros.iso
echo "## CRC Checksum of rancheros.iso - v1.2.0-rc2" && \
sha256sum rancheros.iso | grep \
39da80647a5acf901fca773c103aec9b539cfc8cc1b165882471d0b68373ba29;
[ $? -eq 0 ] && mount -t iso9660 rancheros.iso /mnt || echo bad iso image
echo "## Entering Mounted RancherOS ISO" && \
[ -d /mnt/boot ] \
&& cd /mnt/ \
|| echo exit
echo "## Credentials: ${password} (rancher)" && echo "## Kernel-Executing RancherOS" && \
kexec --initrd ./boot/initrd-v1.2.0-rc2 \
--command-line="rancher.password=${password}" \
./boot/vmlinuz-4.9.78-rancher2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment