In this lab, you will create an inventory in Red Hat Ansible Tower for managing network resources.
Outcomes
You should be able to:
Create an inventory in Red Hat Ansible Tower.
Add a host group to the inventory you created.
Add child groups to a parent group.
Add hosts to groups.
Open Firefox on the workstation VM.
Log in to Ansible Tower at http://tower.lab.example.com as the user admin using student as the password.
Create an inventory in Red Hat Ansible Tower named lab.example.com.
Click the INVENTORIES navigation link at the top of the screen.
Create the new Inventory. On the INVENTORIES screen, click and select (not ).
On the DETAILS panel of the INVENTORIES / CREATE INVENTORY screen, the NAME and ORGANIZATION fields are required.
Use lab.example.com for NAME, and click the magnifying glass icon to select the Default organization.
Click .
Add a host group named network to the inventory you created.
Associate the ansible_connection: network_cli variable and value pair with the group.
Add the child groups vyos and ios to the parent group network.
The vyos group should set the ansible_network_os: vyos and ansible_user: vyos variables.
The ios group should set ansible_network_os: ios and ansible_user: admin variables.
On the DETAILS panel of the INVENTORIES / lab.example.com / GROUPS /network screen, select . Click and select .
On the DETAILS panel of the CREATE GROUP screen, enter vyos in the NAME field.
In the VARIABLES field, define the variables as shown below.
--- ansible_network_os: vyos ansible_user: vyos
Click to finalize the addition of the child group to the inventory.
On the GROUPS panel of the INVENTORIES / lab.example.com / GROUPS /network screen (ASSOCIATED GROUPS), click and select .
On the DETAILS panel of the CREATE GROUP screen, enter ios in the NAME field.
In the VARIABLES field, define the variables as shown below.
--- ansible_network_os: ios ansible_user: admin
Click to finalize the addition of the child group to the inventory.
Add the spine01, spine02, leaf01, and leaf02 hosts to the vyos group.
Add the cs01 host to the ios group.
Add spine01, spine02, leaf01, and leaf02 to the vyos group.
On the GROUPS panel of the INVENTORIES / lab.example.com / GROUPS / network screen (ASSOCIATED GROUPS), click the vyos link.
On the GROUPS panel of the INVENTORIES / lab.example.com / GROUPS / vyos screen (ASSOCIATED GROUPS), select .
On the HOSTS panel, click and select .
On the CREATE HOST screen, enter spine01 in the NAME field.
Click to finalize the addition of the host to the child group.
On the HOSTS panel, click and select to repeat the process and add spine02, leaf01 and leaf02 to the group.
Add cs01 to the ios group.
On the GROUPS link in the breadcrumbs to go to the GROUPS panel of the INVENTORIES / lab.example.com screen.
Click the network link to go to the GROUPS panel of the INVENTORIES / lab.example.com / GROUPS / network screen (ASSOCIATED GROUPS).
Click the ios link to go to the GROUPS panel of the INVENTORIES / lab.example.com / GROUPS / ios screen (ASSOCIATED GROUPS).
Select to go to the HOSTS panel.
Click and select .
Enter cs01 in the HOST NAME field and then click to finalize the addition of the host to the group.
This concludes the lab.