Install automation content navigator on a control node that runs Red Hat Enterprise Linux.
Outcomes
Prepare the workstation machine to run playbooks by using an automation execution environment with the ansible-navigator command.
Examine Visual Studio Code settings.
Use automation content navigator to run a playbook.
As the student user on the workstation machine, use the lab command to prepare your environment for this exercise, and to ensure that all required resources are available.
[student@workstation ~]$ lab start intro-prepare
Instructions
Install development tools for Red Hat Ansible Automation Platform on workstation, which runs Red Hat Enterprise Linux.
A code editor, Visual Studio Code (VS Code), has already been installed. You use it in this course to perform various actions that you could also complete from the command line. These actions include viewing files, editing files, cloning Git repositories, committing and pushing changes to Git repositories, and running automation content navigator.
Test the development tools by using VS Code to run a test Ansible Playbook.
Install software that you use throughout the course.
Check your system for the ansible-core, ansible-navigator, ansible-lint, and podman RPM packages.
[student@workstation ~]$sudo dnf list ansible-core ansible-navigator \ ansible-lint podman[sudo] password for student:studentRed Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs) 100 kB/s | 4.1 kB ... Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPM 134 kB/s | 4.5 kB ... Installed Packages ansible-core.x86_64 2.14.4-1.el9ap @ansible-automation-platform-2.3-fo... podman.x86_64 2:4.2.0-11.el9_1 @rhel-9-for-x86_64-appstream-rpms Available Packages ansible-lint.noarch 6.8.2-1.el9ap ansible-automation-platform-2.3-for... ansible-navigator.noarch 2.2.0-1.el9ap ansible-automation-platform-2.3-for...
The ansible-core and podman packages are already installed.
Install the ansible-navigator and ansible-lint packages.
[student@workstation ~]$sudo dnf install ansible-navigator ansible-lint...output omitted... Is this ok [y/N]:y...output omitted... Complete!
Download the hub.lab.example.com/ee-supported-rhel8 automation execution environment from the lab environment's private automation hub.
Automation content navigator uses it to run the Ansible Playbook.
Use the podman login command to log in to the classroom private automation hub at hub.lab.example.com.
Use student as your username and redhat123 as your password.
[student@workstation ~]$podman login hub.lab.example.comUsername:studentPassword:redhat123Login Succeeded!
Use the podman pull command to download the automation execution environment.
[student@workstation ~]$ podman pull hub.lab.example.com/ee-supported-rhel8
Trying to pull hub.lab.example.com/ee-supported-rhel8:latest...
Getting image source signatures
Copying blob 9d6b728989c4 done
Copying blob a94bd44d2f55 done
Copying blob c7e856e03741 done
Copying blob 8b41bcf810f7 done
Copying config 024856bccc done
Writing manifest to image destination
Storing signatures
024856bccc5fbafddc07cbf758adf1e42d041f478a7c14427b2ca4a9b84294f3Examine VS Code settings. Confirm that the extension is installed.
Open VS Code.
Click on the top bar, type code in the field, and press Enter or click the icon.
![]() |
Navigate to → to display a list of installed and recommended extensions. Notice that the extension has been installed in the lab environment.
Click any extension, such as the extension, to display details about the extension. You can enable or disable an installed extension. You can uninstall or install another version of an extension.
Do not uninstall the Ansible extension. If your lab environment does not provide outside internet access, then you cannot reinstall the extension.
You can adjust the settings for installed extensions. To adjust the settings for the extension, click the icon and then click .
![]() |
Extension settings are a subset of all VS Code settings.
You can access all VS Code settings by clearing the filter, such as the @ext:redhat.ansible filter, or by closing the tab and then navigating to → → .
You can enable or disable the setting directly from the menu.
(Optional) Adjust VS Code settings for your preferences, such as enabling the auto save feature and changing the font size.
Close the tab and any other tabs that you opened.
From within VS Code, open the /home/student/intro-prepare directory and view the sample.yml playbook.
Navigate to → and then navigate to → .
If navigating to → does not appear to do anything, then VS Code probably opened the window behind the current window. Click the date and time in the top bar and then click the notification.
![]() |
Navigate to → and then click .
The first time you open a folder, VS Code displays a window asking if you trust the authors of the files in the folder. Select and then click .
![]() |
Click the sample.yml playbook.
As soon as you open the file, VS Code uses the ansible-lint command to check the playbook for errors.
The lower left corner of the application displays the result of these checks.
The sample.yml playbook does not produce any errors or warnings.
![]() |
Run the sample.yml playbook.
You can either run the playbook from a GNOME terminal or from a VS Code terminal.
To use a VS Code terminal, navigate to → .
Red Hat Enterprise Linux 9 updated the default SELinux policy to disallow commands with text relocation libraries. Because of this change, opening a VS Code terminal generates an SELinux security alert. Note that this policy change does not affect the GNOME terminal.
If you are quick enough, then you can click as soon as you see the SELinux alert notification. Otherwise, you can access the notification by clicking the date and time in the top bar and clicking .
![]() |
You can safely ignore this alert. From the window, click and then close the alert browser window.
More information about this security enhancement can be found by searching for BZ#2055822 at: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/9.0_release_notes/index#enhancement_security
Use the ansible-navigator run command to run the sample.yml playbook.
The playbook displays your configured VS Code settings.
Your settings might be different from the following output.
[student@workstation intro-prepare]$ ansible-navigator run sample.yml -m stdout
...output omitted...
TASK [Display /home/student/.config/Code/User/settings.json] *******************
ok: [workstation] => {
"slurp_settings['content'] | b64decode": {
"editor.fontSize": 11,
"files.autoSave": "afterDelay",
"redhat.telemetry.enabled": false
}
}
PLAY RECAP *********************************************************************
workstation : ok=3 changed=0 unreachable=0 failed=0 ...Close the tab.