0

I'm using Terraform to spin up a DO droplet, using an Ubuntu and Docker image. Checkout below:

resource "digitalocean_droplet" "web" {

  image  = "docker-20-04"
  name   = "web"
  region = "nyc3"
  size   = "s-1vcpu-1gb"

  ssh_keys = [digitalocean_ssh_key.default.id]
  user_data = "I2Nsb3Vk #.....etc......"
  
 }

user_data is my cloud-config template encoded in base64.

I ssh into the droplet and notice that the packages listed in the template below are not getting installed.

#cloud-config
package_upgrade: true
package_update: true
packages:
  - build-essential
  - libmariadbclient-dev
  - libjpeg62-turbo-dev
  - zlib1g-dev
  - libwebp-dev
  - libpq-dev
  - postgresql
  - postgresql-contrib

Is there something wrong with my cloud config file above?

andres
  • 101
  • 1
  • If you look in `/var/lib/cloud/instance`, do you see a `user-data.txt` file? Does it have the content you expect? – larsks Jun 16 '22 at 11:51
  • You should also check curl http://169.254.169.254/metadata/v1/user-data , /var/log/cloud-init-output.log, and /run/cloud-init/instance-data-sensitive.json – Doug Reeder Jul 13 '22 at 19:48

0 Answers0