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)

Preparing to work with Google Cloud Platform

Among various Google Cloud modules, a bunch of Python modules are required to make sure the Ansible modules work smoothly. These modules are as follows:

  • apache-libcloud
  • boto
  • google-api-python-client
  • google-auth
  • google-auth-httplib2

These libraries can be obtained by using Python's pip tool:

$ pip install apache-libcloud boto google-api-python-client google-auth google-auth-httplib2

Along with these libraries, we need to get credentials from Google Cloud. All of the modules, except for the one used for Google Cloud Storage, can use a service account credential JSON file. Service accounts are special accounts typically associated with a non-human entity like a server or an application. This account can be used by applications and servers to interact with various APIs provided by Google Cloud. The advantage of using Service Account...