Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I’m using Ubuntu 16.04 on a droplet using Terraform. I have an existing volume that’s already been formatted that I would like to mount to /home so I can persist my user directory between applications from terraform.
Unfortunately, while /etc/cloud/cloud.cfg lists mounts in it’s cloud_init_modules no entry is ever written to /etc/fstab.
This is in my userdata:
#cloud-config
mounts:
- - '/dev/disk/by-id/scsi-0DO_Volume_volume-name-here-part1'
- '/home'
- 'ext4'
- 'defaults,nofail,discard'
- '0'
- '2'
packages:
- zsh
- git
- ufw
users:
- name: demo
groups: sudo
shell: /bin/zsh
sudo: ['ALL=(ALL) NOPASSWD:ALL']
ssh-authorized-keys:
- 'ssh-rsa <snip>'
runcmd:
# Secure SSHD
- [ sed, -i, -e, 's/^PermitRootLogin yes/PermitRootLogin no/', '/etc/ssh/sshd_config' ]
- [ service, sshd, restart]
- [ rm, -f, /root/.ssh/authorized_keys ]
# Secure UFW
- ufw default deny incoming
- ufw default allow outgoing
- ufw allow ssh
- ufw enable
If I run this command as root, cloud-init -d single -n mounts, the entry is written to /etc/fstab and /home is mounted. Then I need to run mkhomedir_helper demo to recreate my home directory.
How can I get the mounts module to run automatically? The cloud-config docs are…less than ideal and don’t really explain anything in the examples except how to structure the mounts hash.
indranil
doug.landau
ralph1
AI-LastWish
newuser23
Brett Bibby
a9124199d01b441190d9a64b3bf57e
nandaf89840b3eb242fe5d0371
MassiveGrayStarfish
Stian Mathisen
Cosmo Mathieu
fmillion