Ansible

In this section, we are going to take our first steps toward a more comprehensive example in Ansible. For now, we are going to install and configure NGINX, a very popular web server so we can showcase the main concepts of Ansible.

First, we are going to create a VM in Google Cloud Platform with an associated static IP so we can target it from our inventory. We are going to use Terraform in order to do it. First, we'll look at our resources file:

provider "google" {  credentials = "${file("account.json")}"  project = "${var.project_name}"  region = "${var.default_region}"}resource "google_compute_instance""nginx" {  name = "nginx"  machine_type = "n1-standard-1"  zone = "europe-west1-b"  disk {   image = "ubuntu-os-cloud/ubuntu-1704-zesty-v20170413" ...

Get Implementing Modern DevOps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.