Transferring files into the image

It is commonplace, in the experience of the author, to need to inject files into an operating system image to ensure it meets a given set of requirements. These files might be a simple text file, such as an enterprise-standard message of the day, a configuration file for an existing package, or perhaps even a binary file that is not available in a package. Ansible can handle all of these with ease, so let's look at some specific examples. As it is generally good practice to write your Ansible code in roles to support reuse and readability, we will define a role for our example here. In this example, I am making the following assumptions:

  • We have downloaded/built our Linux template as outlined in the previous ...

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.