Skip to content

Instantly share code, notes, and snippets.

@janeczku
Last active June 7, 2018 13:57
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save janeczku/a44f533d9af80e620db7 to your computer and use it in GitHub Desktop.
Save janeczku/a44f533d9af80e620db7 to your computer and use it in GitHub Desktop.
RancherOS iPXE boot script and cloud-config. Ramdisk based deployment with persistent storage on disk. Configures private IP on eth1 from EC2 metadata.
#cloud-config
hostname: rancher-os
ssh_authorized_keys:
- ssh-rsa REPLACE_WITH_PUBLIC_SSH_KEY
rancher:
debug: false
cloud_init:
datasources:
- ec2
state:
formatzero: true
fstype: auto
dev: LABEL=RANCHER_STATE
autoformat:
- /dev/vda
- /dev/sda
network:
dns:
nameservers:
- 8.8.8.8
- 8.8.4.4
interfaces:
eth0:
dhcp: true
eth1:
address: $private_ipv4/16
mtu: 1450
#!ipxe
# Boots RangerOS in Ramdisk with persistent storage on disk /dev/vda
# Location of Kernel/Initrd images
set base-url http://releases.rancher.com/os/latest
kernel ${base-url}/vmlinuz rancher.state.dev=LABEL=RANCHER_STATE rancher.state.formatzero=true rancher.state.autoformat=[/dev/sda,/dev/vda] rancher.cloud_init.datasources=[ec2]
initrd ${base-url}/initrd
boot
@blaggacao
Copy link

I'd suggest console=tty1 rancher.autologin=tty1 so that the VNC console from the web panel logs in without asking for a none existing password. In case of trouble... 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment