Inventories are divided into groups, which may contain hosts and other groups, and hosts. To add a group or host to an inventory or to manage an existing group or host, click on the inventory name.
This screen displays groups and hosts that belong to the selected Inventory.
There are several actions available for inventories.
9.3.1. Groups
Under Groups, you can view which groups belong to this inventory, easily filtered or searched by group name.
Additional actions may be performed on the group by selecting the buttons to the right of the group name:
- Sync status: Show the status of inventory synchronization for groups configured with cloud sources. If synchronization is configured, clicking this button shows the synchronization log for the selected group.
- Host status: Show the status of successful and failed jobs for the selected group. Clicking this button shows the list of hosts that are members of the selected group.
- Start sync process: Initiate a synchronization of the group with the configured cloud source. (A synchronization process that is in progress may be canceled by clicking the cancel button that appears here during synchronization.)
- Edit Group: Edit the properties for the selected group
- Copy Group: Groups can be nested. This allows you to copy or move the group to a different group.
- Delete: Delete the selected group. This operation cannot be reversed!
9.3.1.1. Add a new group
Create a new group for an inventory by clicking the button, which opens the Create Group window.
Enter the appropriate details into the following fields and click Save.
- Name: Required
- Description: Enter an arbitray description as appropriate
- Variables: Enter definitions and values to be applied to all hosts in this group. Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.
By default, the group Source is manual, meaning that the hosts must be entered into Tower manually. (Refer to Add a new host for more information on managing hosts individually.)
To synchronize the inventory group from a cloud source, select the Source tab and choose the appropriate source from the Source menu. Tower 2.2 supports Amazon Web Services EC2, Rackspace Cloud Servers, Google Compute Engine, VMware vCenter, Microsoft Azure, OpenStack, and custom scripts added by the administrator.
All cloud inventory sources have the following update options:
- Overwrite: When checked all child groups and hosts not found on the remote source is deleted from the local inventory. When not checked any local child hosts and groups not found on the external source remains untouched by the inventory update process.
- Overwrite Variables: If checked, all variables for child groups and hosts will be removed and replaced by those found on the external source. When not checked a merge is performed, combining local variables with those found on the external source.
- Update on Launch: Each time a job runs using this inventory, refresh the inventory from the selected source before executing job tasks. To avoid job overflows if jobs are spawned faster than the inventory can sync, selecting this allows you to configure a Cache Timeout to cache prior inventory syncs for a certain number of seconds.
The “Update on Launch” setting refers to a dependency system for projects and inventory, and it will not specifically exclude two jobs from running at the same time. If a cache timeout is specified, then the dependencies for the second job is created and it uses the project and inventory update that the first job spawned. Both jobs then wait for that project and/or inventory update to finish before proceeding. If they are different job templates, they can then both start and run at the same time, if the system has the capacity to do so.
Note
If you intend to use Tower’s provisioning callback feature with a dynamic inventory source, “Update on Launch” should be set for the inventory group.
9.3.1.2. Rackspace Cloud Servers
To configure a group for Rackspace, select Rackspace Cloud Servers and enter the following details:
- Cloud Credential: Choose from an existing Credential. For more information, refer to Credentials.
- Regions: Click on the regions field to see a list of regions for your cloud provider. You can select multiple regions, or choose “All” to include all regions. Tower will only be updated with Hosts associated with the selected regions.
You can also configure Update Options.
- Overwrite: If checked, all child groups and hosts not found on the external source are deleted from the local inventory. When not checked, local child hosts and groups not found on the external source remain untouched by the inventory update process.
- Overwrite Variables: If checked, all variables for child groups and hosts are removed and replaced by those found on the external source. When not checked, a merge is performed, combining local variables with those found on the external source.
- Update on Launch: Each time a job runs using this inventory, refresh the inventory from the selected source before executing job tasks.
9.3.1.3. Amazon Web Services EC2
To configure a group for AWS, select Amazon EC2 and enter the
following details:
Cloud Credential: Choose from an existing credential (for more information, refer to Credentials).
If Tower is running on an EC2 instance with an assigned IAM Role, the credential may be omitted, and the security credentials from the instance metadata will be used instead. For more information on using IAM Roles, refer to the IAM_Roles_for_Amazon_EC2_documentation_at_Amazon.
Regions: Click on the regions field to see a list of regions for your cloud provider. You can select multiple regions, or choose “All” to include all regions. Tower will only be updated with Hosts associated with the selected regions.
Instance Filters: Rather than importing your entire Amazon EC2 inventory, filter the instances returned by the inventory script based on a variety of metadata. Hosts are imported if they match any of the filters entered here.
Examples:
- To limit to hosts having the tag
TowerManaged
: Enter tag-key=TowerManaged
- To limit to hosts using either the key-name
staging
or production
: Enter key-name=staging, key-name=production
- To limit to hosts where the
Name
tag begins with test
: Enter tag:Name=test*
For more information on the filters that can be used here, refer to the
DescribeInstances documentation at Amazon.
Only Group By
By default, Tower creates groups based on the following Amazon EC2 parameters:
- Availability Zones
- Image ID
- Instance Type
- Key Name
- Region
- Security Group
- Tags (by name)
- VPC ID
If you do not want all these groups created, select from the dropdown the list of groups that you would like created by default. You can also select Instance ID
to create groups based on the Instance ID of your instances.
Source Variables
Override variables found in ec2.ini
and used by the inventory update script. For a detailed description of these variables view ec2.ini in the Ansible GitHub repo.
Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.
You can also configure Update Options.
- Overwrite: If checked, all child groups and hosts not found on the external source are deleted from the local inventory. When not checked, local child hosts and groups not found on the external source remain untouched by the inventory update process.
- Overwrite Variables: If checked, all variables for child groups and hosts are removed and replaced by those found on the external source. When not checked, a merge is performed, combining local variables with those found on the external source.
- Update on Launch: Each time a job runs using this inventory, refresh the inventory from the selected source before executing job tasks.
9.3.1.4. Google Compute Engine
To configure a group for Google Compute Engine, select Google Compute
Engine and enter the following details:
- Cloud Credential: Choose from an existing Credential. For more information, refer to Credentials.
- Regions: Click on the regions field to see a list of regions for your cloud provider. You can select multiple regions, or choose “All” to include all regions. Tower will only be updated with Hosts associated with the selected regions.
You can also configure Update Options.
- Overwrite: If checked, all child groups and hosts not found on the external source are deleted from the local inventory. When not checked, local child hosts and groups not found on the external source remain untouched by the inventory update process.
- Overwrite Variables: If checked, all variables for child groups and hosts are removed and replaced by those found on the external source. When not checked, a merge is performed, combining local variables with those found on the external source.
- Update on Launch: Each time a job runs using this inventory, refresh the inventory from the selected source before executing job tasks.
9.3.1.5. Microsoft Azure
To configure a group for Microsoft Azure, select Microsoft Azure and
enter the following details:
- Cloud Credential: Choose from an existing Credential. For more information, refer to Credentials.
- Regions: Click on the regions field to see a list of regions for your cloud provider. You can select multiple regions, or choose “All” to include all regions. Tower will only be updated with Hosts associated with the selected regions.
You can also configure Update Options.
- Overwrite: If checked, all child groups and hosts not found on the external source are deleted from the local inventory. When not checked, local child hosts and groups not found on the external source remain untouched by the inventory update process.
- Overwrite Variables: If checked, all variables for child groups and hosts are removed and replaced by those found on the external source. When not checked, a merge is performed, combining local variables with those found on the external source.
- Update on Launch: Each time a job runs using this inventory, refresh the inventory from the selected source before executing job tasks.
9.3.1.6. VMware vCenter
To configure a group for VMware vCenter, select VMware and enter the
following details:
- Cloud Credential: Choose from an existing Credential. For more information, refer to Credentials.
- Source Variables: Override variables found in
vmware.ini
and used by the inventory update script. For a detailed description of these variables view vmware.ini in the Ansible GitHub repo. Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.
You can also configure Update Options.
- Overwrite: If checked, all child groups and hosts not found on the external source are deleted from the local inventory. When not checked, local child hosts and groups not found on the external source remain untouched by the inventory update process.
- Overwrite Variables: If checked, all variables for child groups and hosts are removed and replaced by those found on the external source. When not checked, a merge is performed, combining local variables with those found on the external source.
- Update on Launch: Each time a job runs using this inventory, refresh the inventory from the selected source before executing job tasks.
9.3.1.7. OpenStack
To configure a group for OpenStack, select OpenStack and enter the following details:
- Cloud Credential: Choose from an existing Credential. For more information, refer to Credentials.
- Source Variables: Override variables found in
openstack.yml
and used by the inventory update script. For a detailed description of these variables view openstack.yml in the Ansible GitHub repo. Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.
You can also configure Update Options.
- Overwrite: If checked, all child groups and hosts not found on the external source are deleted from the local inventory. When not checked, local child hosts and groups not found on the external source remain untouched by the inventory update process.
- Overwrite Variables: If checked, all variables for child groups and hosts are removed and replaced by those found on the external source. When not checked, a merge is performed, combining local variables with those found on the external source.
- Update on Launch: Each time a job runs using this inventory, refresh the inventory from the selected source before executing job tasks.
9.3.1.8. Custom Script
Tower allows you to use a custom dynamic inventory script, if your administrator has added one.
To configure a group to use a Custom Inventory Script, select Custom Script and enter the following details:
Custom Inventory Script: Choose from an existing Inventory Script. For information on how to add custom inventory scripts to Tower, refer to Custom Inventory Scripts.
Environment Variables: Set variables in the environment to be used by the inventory update script. The variables would be specific to the script that you have written.
Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.
You can also configure Update Options.
- Overwrite: If checked, all child groups and hosts not found on the external source are deleted from the local inventory. When not checked, local child hosts and groups not found on the external source remain untouched by the inventory update process.
- Overwrite Variables: If checked, all variables for child groups and hosts are removed and replaced by those found on the external source. When not checked, a merge is performed, combining local variables with those found on the external source.
- Update on Launch: Each time a job runs using this inventory, refresh the inventory from the selected source before executing job tasks.
9.3.1.9. Scheduling
For groups sourced from a cloud service, the inventory update process may be scheduled via the Schedule tab. To access the Schedule tab, click the button beside the Inventory Group name to open the Edit Group dialog.
This screen displays a list of the schedules that are currently available for the selected Group. The schedule list may be sorted and searched by Name.
The list of schedules includes:
- Name (Clicking the schedule name opens the Edit Schedule dialog)
- First Run
- Next Run
Buttons located in the upper right corner of the Schedules screen
provide the following actions:
- Create a new schedule
- Refresh this view
9.3.1.9.1. Add a new schedule
To create a new schedule click the button.
Enter the appropriate details into the following fields and select Save:
- Name (required)
- Start Date (required)
- Start Time (required)
- Local Time Zone (the entered Start Time should be in this timezone)
- UTC Start Time (calculated from Start Time + Local Time Zone)
- Repeat Frequency (the appropriate options are displayed as the update frequency is modified.
The View Details link at the bottom displays a description of the schedule and a list of the scheduled occurrences in the selected Local Time Zone.
Note
Jobs are scheduled in UTC. Repeating jobs that runs at a specific time of day may move relative to a local timezone when Daylight Saving Time shifts occur.
Once you have saved the schedule, it can be viewed on the Schedule tab.
There are server actions available for schedules:
- Stop an active schedule or activate a stopped schedule
- Edit schedule
- Delete schedule
9.3.2. Hosts
Hosts are listed on the right side of the Inventory display screen.
The host list may be sorted and searched by Name or Groups, and filtered by hosts that are disabled, by hosts with failed jobs, and by hosts synchronized with an external source.
This list displays information about each host and provides for several actions:
- Name: Opens the Host Properties dialog
- Available: A toggle indicating whether the host is enabled to receive jobs from Tower. Click to toggle this setting.
- Jobs: Shows the most recent Jobs run against this Host. Clicking this button displays a window showing the most recent jobs and their status.
- Edit host: Opens the Host Properties dialog
- Copy host: Copies or moves the host to a different group
- Delete: Removes the host from Tower. This operation is not reversible!
9.3.2.1. Add a new host
To create a new host and add it to an existing group, click the button.
This opens the Create New Host dialog.
Enter the appropriate details into the following fields and click Save:
- Host Name: The hostname or IP address of the host
- Description: Enter an arbitrary description as appropriate
- Enabled?: Indicates if a host is available and should be included in running jobs. For hosts that are part of an external inventory, this flag cannot be changed. It is set by the inventory sync process.
- Variables: Variable definitions and values to be applied to the selected host. Enter variables using either JSON or YAML syntax, using the radio button to toggle between JSON or YAML.