Create a static inventory in automation controller and grant teams permission to administer and use that inventory.
Outcomes
Create a static inventory containing hosts and a host group.
Assign appropriate inventory permissions to a team.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command ensures that automation controller is installed and configured with any necessary resources created in previous exercises. The command also creates an additional inventory, with hosts and a host group, needed for this exercise.
[student@workstation ~]$ lab start host-inventory
Procedure 3.1. Instructions
Navigate to https://controller.lab.example.com and log in as the admin user with redhat as the password.
Create a static inventory named Prod.
Navigate to → and then click → .
On the page, enter the following details:
| Field | Value |
|---|---|
Prod
| |
Production Inventory
| |
Default
|
Click to create the new inventory. You are redirected to the inventory page for the Prod inventory.
Create the prod_servers group in the Prod inventory.
Click the tab and then click to add a new group.
On the page, enter the following details:
| Field | Value |
|---|---|
prod_servers
| |
Production servers
|
Click to create the new group.
Add the servere.lab.example.com host to the prod_servers group in the Prod inventory.
Click the tab to add hosts to the group you just created.
Click → to add a new host to the group.
On the page, enter the following details:
| Field | Value |
|---|---|
servere.lab.example.com
| |
Server E
|
Click to add the new host.
Assign the Operations team the Admin role on the Prod inventory.
Navigate to → and then click the link for the Prod inventory entry.
On the tab, click to add permissions.
Click and then click to display the list of available teams.
Select the Operations team, and then click to display the possible roles to apply.
Select the Admin role.
Click to finalize the role assignment. This redirects you to the list of permissions for the Prod inventory, which now shows that all members of the Operations team are assigned the Admin role on the Prod inventory.
Verify access to the Prod inventory with the oliver user, who belongs to the Operations team.
Log out and log back in as the oliver user using redhat123 as the password. This user is assigned the Member role for the Operations team.
Navigate to → and then click the link for the Prod inventory created earlier.
Review the contents of the Prod inventory to see the hosts and group it contains.
Add the serverf.lab.example.com host to the Prod inventory while logged in as the oliver user.
Click → and then click the link for the inventory.
On the tab, click the link for the prod_servers group to enter the group.
On the tab, click → to add a new host to the group.
On the page, enter the following details, and then click :
| Field | Value |
|---|---|
serverf.lab.example.com
| |
Server F
|
Assign the Use role on the Test inventory to the Developers team.
Log out and log back in as the admin user with redhat as the password.
Navigate to → and click the link for the Test inventory.
On the tab, click to add permissions.
Click and then click to display the list of available teams.
Select the Developers team, and then click to display the possible roles to apply.
Select the Use role and then click . This redirects you to the list of permissions for the Test inventory, which now shows that normal members of the Developers team are assigned the Use role on the Test inventory. The donnie user does not inherit this permission because donnie only has read access on the Developers team.
Verify access to the Test inventory with the daniel user, who belongs to the Developers team.
Log out and then log back in as the daniel user with the password redhat123. This user is assigned the Admin role for the Developers team.
Navigate to → and click the link for the Test inventory.
Review the contents of the Test inventory to see the hosts and group it contains. Note that even though daniel is an Admin of the Developers team, he cannot manage the Test inventory because you only granted the Use role for the inventory to the Developers team.
This is representative of a real world scenario where developers might have access to the list of systems in the testing environment but are not able to modify the list.
Log out of the automation controller web UI.