Book Image

Continuous Delivery with Docker and Jenkins - Second Edition

By : Rafał Leszko
Book Image

Continuous Delivery with Docker and Jenkins - Second Edition

By: Rafał Leszko

Overview of this book

Continuous Delivery with Docker and Jenkins, Second Edition will explain the advantages of combining Jenkins and Docker to improve the continuous integration and delivery process of an app development. It will start with setting up a Docker server and configuring Jenkins on it. It will then provide steps to build applications on Docker files and integrate them with Jenkins using continuous delivery processes such as continuous integration, automated acceptance testing, and configuration management. Moving on, you will learn how to ensure quick application deployment with Docker containers along with scaling Jenkins using Kubernetes. Next, you will get to know how to deploy applications using Docker images and testing them with Jenkins. Towards the end, the book will touch base with missing parts of the CD pipeline, which are the environments and infrastructure, application versioning, and nonfunctional testing. By the end of the book, you will be enhancing the DevOps workflow by integrating the functionalities of Docker and Jenkins.
Table of Contents (18 chapters)
Title Page
Dedication
About Packt
Contributors
Preface
Index

Using Ansible


In order to use Ansible, we first need to define the inventory, which represents the available resources. Then, we will be able to either execute a single command or define a set of tasks using the Ansible playbook.

Creating an inventory

An inventory is a list of all the servers that are managed by Ansible. Each server requires nothing more than the Python interpreter and the SSH server installed. By default, Ansible assumes that the SSH keys are used for authentication; however, it is also possible to use the username and the password, by adding the --ask-pass option to the Ansible commands.

Note

SSH keys can be generated with the ssh-keygen tool, and they are usually stored in the ~/.ssh directory.

The inventory is defined in the /etc/ansible/hosts file, and it has the following structure:

[group_name]
<server1_address>
<server2_address>
...

Note

The inventory syntax also accepts ranges of servers; for example, www[01-22].company.com. The SSH port should also be specified...