Skip to content

Instantly share code, notes, and snippets.

@faddat
Forked from janeczku/cloud-config.yaml
Created October 29, 2015 11:43
Show Gist options
  • Save faddat/33c9fdfb5e6d7f960049 to your computer and use it in GitHub Desktop.
Save faddat/33c9fdfb5e6d7f960049 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 AAAABBBBBBCCCCCCC...
write_files:
- path: /opt/rancher/bin/start.sh
permissions: 0700
content: |
#!/bin/bash
# Configure private network on eth1
sudo netconf
rm -- "$0"
rancher:
cloud_init:
datasources:
- ec2
network:
dns:
nameserver:
- 8.8.4.4
- 4.2.2.3
interfaces:
eth0:
dhcp: true
eth1:
address: $private_ipv4/16
mtu: 1450
state:
fstype: auto
dev: LABEL=RANCHER_STATE
autoformat:
- /dev/vda
#!ipxe
# Boots RangerOS in Ramdisk with persistent storage on disk /dev/vda
# Location of Kernel/Initrd images
set base-url https://releases.rancher.com/os/latest
kernel ${base-url}/vmlinuz rancher.state.autoformat=[/dev/vda] rancher.cloud_init.datasources=[ec2]
initrd ${base-url}/initrd
boot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment