/cloudinit

Primary LanguageShellMIT LicenseMIT

cloud-init

When provisioning a new Ubuntu 16.04 server on the cloud, write the following code in the User data field at your cloud service provider provisioning page. This is applicable for both AWS EC2 & DigitalOcean Droplet instances:

#cloud-config
system_info:
  default_user:
    name: rinvex
runcmd:
  - wget https://raw.githubusercontent.com/rinvex/cloudinit/master/commands.sh
  - chmod +x commands.sh
  - ./commands.sh
  - wget https://raw.githubusercontent.com/rinvex/cloudinit/master/provision.sh
  - chmod +x provision.sh
  - ./provision.sh

Notes:

  1. Some configurations has been ommitted since the default AWS Ubuntu AMI, and the default DigitalOcean Ubuntu Droplet has these config by default.
  2. Notice that the provisioning script uses rinvex as a default user system-wide, change if required.
  3. This is intended to be just web server, that's why no database or other software config included.
  4. Tested only in AWS EC2 Ubuntu 16.04, but should work with DigitalOcean droplets as well.
  5. Log file found on provisioned server here: /var/log/cloud-init-output.log
  6. References: