Documentation

8. Create a new Inventory and add it to the Organization

An inventory is a collection of hosts managed by Tower. Inventories are assigned to organizations, while permissions to launch playbooks against inventories are controlled at the user and/or team level. For more information, refer to Inventories, Users - Permissions, and Teams - Permissions in the Ansible Tower User Guide.

To review existing inventories:

  1. Click the Inventories (inventories-icon) icon from the left navigation bar.

  1. Click the add button and select Inventory from the drop-down menu list. Smart Inventories are described in further detail in Smart Inventories.

Inventories - create new inventory

Ansible Tower provides a demo inventory for you to use as you learn how Tower works. Click on the “Demo Inventory” link for the stock inventory provided by Ansible Tower.

8.1. Groups and Hosts

Note that inventories are divided into groups and hosts. A group might represent a particular environment (e.g. “Datacenter 1” or “Stage Testing”), a server type (e.g. “Application Servers” or “DB Servers”), or any other representation of your environment. The groups and hosts that belong to the Demo inventory are shown in the Groups and Hosts tabs, respectively.

Inventories - Demo inventory details

  1. In the Groups tab, click the add button to add groups to the inventory.

Inventories - click to create new group

  1. Similarly, in the Hosts tab, click the add button to add hosts to groups.

Inventories - click to create new host

Note

Prior to Ansible Tower 2.2, hosts could not be added to the Web Servers inventory before adding a group. If you are using an older version of Tower, click the “Plus” button above the ‘Groups’ section to add a group before adding a host.

For this example, suppose that the organization you created earlier has a group of web server hosts supporting the corporate CMS application. To add these hosts to the Web Servers inventory, create a “CMS Web” group. Click the Save button to create the group.

For the purposes of this Quick Start and to test that Tower is setup properly, a local host has been added for your use.

Inventories - host properties form

Click Cancel (if no changes were made) or use the breadcrumb navigational links at the top of the Ansible Tower browser to return to the Inventories overview screen. Clicking Save does not exit the edit dialog.