Skip to content

Instantly share code, notes, and snippets.

@dctrwatson
Last active February 12, 2018 14:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dctrwatson/7206322 to your computer and use it in GitHub Desktop.
Save dctrwatson/7206322 to your computer and use it in GitHub Desktop.
Jank way to use instance storage automatically in EC2
#cloud-config
mounts:
- [ ephemeral0, /var, ext4, "defaults,noatime", "0", "2" ]
- [ swap, null ]
bootcmd:
- mkdir -p /tmp/root
- mount --bind / /tmp/root
- rsync -aq /tmp/root/var/lib/cloud /var/lib/
- [ cloud-init-per, instance, rsync_var, rsync, -aq, /tmp/root/var/, /var ]
- [ cloud-init-per, instance, restart_cron, service, restart, cron ]
cloud_init_modules:
- mounts
- resizefs
- bootcmd
- set_hostname
- update_hostname
- update_etc_hosts
- ca-certs
- rsyslog
- ssh
cloud_config_modules:
- ssh-import-id
- locale
- set-passwords
- grub-dpkg
- apt-pipelining
- apt-update-upgrade
- landscape
- timezone
- disable-ec2-metadata
- runcmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment