O'Reilly logo

Implementing Modern DevOps by David Gonzalez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required