Exercise: Writing an Inventory

Practice how to write an inventory for an Ansible project.

We'll cover the following

Task

You need to come up with a hosts file (INI format) for an infrastructure project of a tech startup that needs to manage its IT infrastructure, with specific needs as listed below:

  • A cluster of three database servers.
  • A cluster of three load balancers.
  • Two servers for managing caching services.
  • Two servers for managing the messaging queue.
  • Two web servers running Apache and one web server running NGINX.
  • One server for monitoring and insight.
  • One server for critical backups.

Based on these requirements, devise a suitable inventory for the project.

Note: Please include the relevant connection parameters for each host, like the username and the password. Also, assign the IP addresses in a sequential manner.

If you’re unsure how to do this, click the “Show Hint” button.

Get hands-on with 1400+ tech skills courses.