Book Image

Ansible 2 Cloud Automation Cookbook

By : Aditya Patawari, Vikas Aggarwal
Book Image

Ansible 2 Cloud Automation Cookbook

By: Aditya Patawari, Vikas Aggarwal

Overview of this book

Ansible has a large collection of inbuilt modules to manage various cloud resources. The book begins with the concepts needed to safeguard your credentials and explain how you interact with cloud providers to manage resources. Each chapter begins with an introduction and prerequisites to use the right modules to manage a given cloud provider. Learn about Amazon Web Services, Google Cloud, Microsoft Azure, and other providers. Each chapter shows you how to create basic computing resources, which you can then use to deploy an application. Finally, you will be able to deploy a sample application to demonstrate various usage patterns and utilities of resources.
Table of Contents (11 chapters)

Setting up Docker Registry

Docker Registry is a scalable server where we can store our Docker images. The benefit of running Docker Registry for storing images instead of using Docker Hub is that we can own the images created. Our build or deploy pipelines don't need to rely on Docker Hub. Some other prominent advantages of using a self-hosted Docker Registry are as follows:

  • We can co-locate the registry with the application servers, which will reduce the time of deployment
  • It helps save bandwidth
  • It can help in compliance, in case we need to satisfy something that Docker Hub is missing

In this recipe, we will write a task to create a Docker Registry using a Docker container.

How to do it...

  1. Let's define a task...