An example playbook

Before we complete this chapter, I am going to share an example playbook I wrote for deploying a small number of virtual machines in a VMware cluster. The idea with the project was to launch seven virtual machines into a customer's network which are as follows:

  • One Linux jump host
  • One NTP server
  • One load balancer
  • Two web servers
  • Two database servers

The VMs all had to be built from an existing template; unfortunately, this template was built with a hardcoded gateway IP address of 192.168.1.254 in the /etc/sysconfig/network file. This meant that for these machines to correctly appear on the network, I had to make changes to each of the virtual machines once they had been launched.

I started off by setting up a file called ...

Get Learn Ansible 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.