Using cloud-init on AWS, Digital Ocean, or OpenStack
As cloud-init is an initialization system for cloud instances, we need to find a way to send the cloud-config YAML file to the bootstrapping process. On all IaaS providers supporting cloud-init, there's a field where we can paste our file. We'll review how cloud-init works on three important IaaS providers—AWS, Digital Ocean, and OpenStack.
Getting ready
To step through this recipe, you will need an account on Amazon Web Services, Digital Ocean, or some OpenStack deployment, or on all of them if you want to try them all!
How to do it…
To illustrate cloud-init usage, we'll create the simplest cloud-config file on Ubuntu 16.04 and CentOS 7.2, installing packages such as htop
, tcpdump
, docker
, or nmap
that aren't usually installed by default on most Linux distributions. This is how a very simple cloud-config file looks:
#cloud-config # Install packages on first boot packages: - tcpdump - docker - nmap