Book Image

Puppet for Containerization

By : Scott Coulton
Book Image

Puppet for Containerization

By: Scott Coulton

Overview of this book

This book teaches you how to take advantage of the new benefits of containerization systems such as Docker, Kubernetes, Docker Swarm, and Docker UCP, without losing the panoptical power of proper configuration management. You will learn how to integrate your containerized applications and modules with your Puppet workflow. You will also understand how to manage, monitor, and orchestrate hosts to keep deployed containers running seamlessly. With the help of this book, you can efficiently automate and document with containers, as a part of your system. The book will also cover use cases of deploying Puppet within a containerized environment.
Table of Contents (16 chapters)

Coding using .erb files


In this topic, we are going to deploy the same container using docker-compose with a twist. The twist is with Puppet, where we can turn the docker-compose.yml file into docker-compose.yml.erb. This allows us to take advantage of all the tools Puppet gives us to manipulate template files. This is definitely the way I like to deploy containers with Puppet; however, I will let you decide for yourself the method you like best as we continue through the book.

Writing our module with Docker Compose

In the chapter, we are going to look at how to use docker-compose as an .erb template file. In this example, we are only deploying a single container, but when an application contains five or six containers with links, this way is much more efficient than using the standard manifest declarations.

So, we will take our consul module from the last topic and modify it now to use docker-compose. If you want to keep that module, just make a copy. First, we are not going to touch init...