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)

Docker_bitbucket (Docker Compose)


In this topic, we are going to build the same Bitbucket application. The difference this time is that we are going to use docker-compose as a .erb file instead of the resource declarations in a manifest.

Let's code – take 2

We covered a lot of what happens under the hood in the last topic. We will not be repeating ourselves, so this topic will be just about the code. We are going to keep both init.pp and params.pp the same as we did in the last topic. So, let's jump straight to install.pp. It will look very similar to install.pp from the last chapter:

All the magic happens in our template file. So, let's jump to our .erb file that lives in the templates folder in the root of our module:

As you can see in our .erb file in the preceding screenshot, all the configurations are familiar. There are absolutely no changes to what we covered in our last topic.

Running our module – take 2

Let's open our terminal and change the directory to the root of our Vagrant repo and...