Configure your automation controller as a control node that is connected using automation mesh to three execution nodes, one of which is behind a hop node.
Outcomes
Configure an inventory file to support automation mesh.
Install automation mesh.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command downloads and extracts the Red Hat Ansible Automation Platform 2.2 bundled archive into the /home/student/aap2.2-bundle directory. It also downloads machine certificates and private keys into the /home/student/certs directory. Finally, it replaces the inventory file in the extracted bundle with the inventory file used in the chapter 1 installation guided exercise.
[student@workstation ~]$ lab start mesh-deploy
Procedure 11.1. Instructions
Update the /home/student/aap2.2-bundle/inventory file to install a second automation controller, two execution nodes and a hop node connected directly to the automation controllers using automation mesh, and a third execution node that is connected to the hop node.
Change to the /home/student/aap2.2-bundle directory.
[student@workstation ~]$ cd ~/aap2.2-bundle/Update the inventory file to add control2.lab.example.com to the [automationcontroller] section:
[automationcontroller]
controller.lab.example.com
control2.lab.example.comConfigure the [automationcontroller:vars] section to add the node_type, web_server_ssl_cert, and web_server_ssl_key variables. Remove the existing peers=execution_nodes line. The updated inventory file contains the following lines for the [automationcontroller:vars] section:
[automationcontroller:vars]node_type=controlweb_server_ssl_cert=/home/student/certs/{{ inventory_hostname }}.crtweb_server_ssl_key=/home/student/certs/{{ inventory_hostname }}.key
Because the [automationcontroller:vars] section now configures unique web server SSL certificates and keys for each automation controller host, comment out the existing web_server_ssl_cert and web_server_ssl_key variables in the [all:vars] section. The existing lines change to the following:
#web_server_ssl_cert=/home/student/certs/controller.lab.example.com.crt#web_server_ssl_key=/home/student/certs/controller.lab.example.com.key
Update the inventory file to add hosts to the [execution_nodes] section.
Add the exec1.lab.example.com and exec2.lab.example.com hosts and specify that they peer with the automationcontroller group.
Add the exec3.lab.example.com host and specify that it peers with the hop1.lab.example.com host.
Add the hop1.lab.example.com host and specify that it peers with the automationcontroller group and that it is a hop node.
The updated inventory file contains the following lines for the [execution_nodes] section:
[execution_nodes]exec1.lab.example.com peers=automationcontrollerexec2.lab.example.com peers=automationcontrollerexec3.lab.example.com peers=hop1.lab.example.comhop1.lab.example.com peers=automationcontroller node_type=hop
Use the diff command to compare your modified inventory file with the ~/mesh-deploy/inventory file. The diff command does not display any output if the files have the same content. The -B option ignores blank lines. Correct any mistakes before proceeding.
[student@workstation aap2.2-bundle]$ diff -B inventory ../mesh-deploy/inventoryGenerate and view the automation mesh topology file.
Run the setup.sh script using the generate_dot_file tag.
[student@workstation aap2.2-bundle]$ ./setup.sh -- --tags generate_dot_file
...output omitted...
TASK [debug] *******************************************************************
ok: [controller.lab.example.com] => {
"msg": "Ansible Mesh topology graph created at 'mesh-topology.dot'. To render your dot graph, you could run: dot -Tjpg mesh-topology.dot -o graph-topology.jpg\n"
}
...output omitted...Display the generated mesh-topology.dot topology file.
[student@workstation aap2.2-bundle]$ cat mesh-topology.dot
strict digraph "" {
rankdir = TB
node [shape=box];
subgraph cluster_0 {
graph [label="Control Nodes", type=solid];
{
rank = same;
"controller.lab.example.com";
"control2.lab.example.com";
"controller.lab.example.com" -> "control2.lab.example.com";
}
}
"exec1.lab.example.com";
"exec2.lab.example.com";
"exec3.lab.example.com";
"hop1.lab.example.com";
"exec1.lab.example.com" -> "control2.lab.example.com";
"exec1.lab.example.com" -> "controller.lab.example.com";
"exec2.lab.example.com" -> "control2.lab.example.com";
"exec2.lab.example.com" -> "controller.lab.example.com";
"exec3.lab.example.com" -> "hop1.lab.example.com";
"hop1.lab.example.com" -> "control2.lab.example.com";
"hop1.lab.example.com" -> "controller.lab.example.com";
}Install the graphviz package.
[student@workstation aap2.2-bundle]$sudo dnf install graphviz[sudo] password for student:student...output omitted...
Render the generated topology file as a graphic.
[student@workstation aap2.2-bundle]$dot -Tjpg mesh-topology.dot \>-o graph-topology.jpg...output omitted...
Open the generated graphic file, graph-topology.jpg, in a web browser.
Install automation mesh by applying the changes made to the inventory file.
Become the root user.
[student@workstation aap2.2-bundle]$sudo -i[sudo] password for student:student[root@workstation ~]#
Change to the /home/student/aap2.2-bundle directory.
[root@workstation ~]# cd /home/student/aap2.2-bundle/Run the setup.sh script with -e ignore_preflight_errors=true set to ignore the results of checks it makes before the installation starts. (The classroom systems have less RAM than is optimal for a production installation.) The installation takes approximately 15 minutes to complete.
[root@workstation aap2.2-bundle]# ./setup.sh -e ignore_preflight_errors=true
...output omitted...
PLAY RECAP *********************************************************************
control2.lab.example.com : ok=246 changed=129 ... failed=0 ... ignored=5
controller.lab.example.com : ok=263 changed=54 ... failed=0 ... ignored=1
db.lab.example.com : ok=75 changed=16 ... failed=0 ... ignored=1
exec1.lab.example.com : ok=104 changed=51 ... failed=0 ... ignored=3
exec2.lab.example.com : ok=104 changed=51 ... failed=0 ... ignored=3
exec3.lab.example.com : ok=104 changed=51 ... failed=0 ... ignored=3
hop1.lab.example.com : ok=83 changed=36 ... failed=0 ... ignored=2
hub.lab.example.com : ok=195 changed=23 ... failed=0 ... ignored=1
localhost : ok=3 changed=1 ... failed=0 ... ignored=0
The setup process completed successfully.
[warn] /var/log/tower does not exist. Setup log saved to setup.log.After the installer finishes successfully, exit from the root session.
[root@workstation aap2.2-bundle]# exitAccess the https://controller.lab.example.com and https://control2.lab.example.com automation controllers.
Navigate to https://controller.lab.example.com and log in as the admin user with redhat as the password.
In a separate browser window or tab, navigate to https://control2.lab.example.com and log in as the admin user with redhat as the password.
View the hosts in the controlplane and default instance groups.
Navigate to → .
![]() |
Click the link for the instance group and then click the tab. Both the and the hosts display the status. If you click the link for each hostname, then the page displays that each host is the node type.
Navigate to → and click the link for the instance group.
Click the tab. The , , and hosts display the status. If you click the link for each hostname, then the page displays that each host is the node type.