Using cloud-init to run post-installation commands

Cloud-init was originally developed by Canonical and is the de facto standard for running post-installation commands and configuration on a cloud instance. When an instance is launched, if cloud-init is part of the image being used, it will look for metadata information passed to it at launch time to do post-installation execution of commands. When a shell script is used (as demonstrated in the following How to do it… section of this recipe), it can be analogous to running commands in the /etc/rc.local working directory of a Linux machine. Cloud-init relies on data being sent from the nova-metadata API service. An instance looks for data associated with the particular instance and executes it ...

Get OpenStack: Building a Cloud Environment now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.