Cleaning up the build with Ansible

By now, you should have a pretty good idea of how to build or validate a base image, and then customize it with Ansible. Before we close this chapter, it is worth revisiting the task of cleaning up your image for deployment. Whether you have built an image from scratch or downloaded a ready-made one, if you have booted it up and run commands on it, either manually or using Ansible, you are likely to have a whole load of items that you really don't want present every time you deploy the image. For example, do you really want all of the system log files from every configuration task you performed and the initial boot to be present on every single virtual machine deployed? If you had to run any commands by ...

Get Hands-On Enterprise Automation on Linux 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.