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" } network_interface { network = "default" access_config { nat_ip = "${google_compute_address.nginx-ip.address}" } } } resource "google_compute_address" "nginx-ip" { name = "nginx-ip" }
And now, we'll...