With the introduction of Red Hat Ansible Automation Platform 2, several new key components are being introduced as a part of the overall developer experience. This includes automation execution environments, introduced to provide predictable environments during automation runtime. All collection dependencies are contained within the execution environment to make sure that automation created in development environments runs the same as in production environments.
Building execution environments is now easier with the introduction of the execution environment builder (ansible-builder) tool included with Ansible Automation Platform, while the updates to automation controller help IT teams leverage execution environments.
Considering the shift towards containerized execution of automation, the automation development workflow and pre-existing tooling must be reimagined. In short, ansible-navigator replaces ansible-playbook and other ansible-*` command line utilities.
However, ansible-navigator serves a much greater purpose than just a drop in replacement or alias to ansible-playbook. With this release, ansible-navigator is introduced as an application exclusively for developing and executing automation. Ansible-playbook has long been one of the first utilities that is leveraged in an Ansible automated environment. Building on the ease of use, the automation content navigator exposes automation runs in greater detail. Apart from debugging automation, ansible-navigator also allows inspection of multiple aspects of the environment, including automation execution environments, inventories, collections, modules and more through the use of subcommands.
Who will use automation content navigator?
The automation content navigator is mainly geared towards developers of automation. This can mean people creating automated tasks with available modules, those migrating roles into Collections or those who are developing modules from the ground up. Content navigator runs as a textual user interface and looks great within a terminal session, even while running inside popular code editors with included terminal panes.
Initial view of text user interface (TUI)
Launching navigator without any additional options brings up a welcome screen that displays the different subcommands that are available.
Moving around the interface is quite simple and reminders for the navigation keys are listed at the bottom of the interface. Subcommands can be entered in a vim-like fashion using the format :<command>.
Exploring the local environment
Each project can have its own navigator configuration (ansible-navigator.yml). Common configuration parameters can be names of execution environment images required for the project, Ansible configuration parameters such as forks, log levels, artifact creation, etc. By configuring the content navigator on a project basis, other contributors are more easily able to branch, fork and otherwise extend automation projects.
ansible-navigator:
ansible:
inventories:
- hosts
execution-environment:
enabled: true
container-engine: podman
image: ansible-automation-platform-20-ee-supported-rhel8
pull-policy: missing
The automation content navigator also has built in subcommands to allow developers easy access to explore the environment. Two very useful subcommands in this context are :inventory which allows for traversing of the project's inventory, and :collections which allows developers to quickly see which Collections are available within the specified execution environment. Expanding one of the Collections returned, shows a list of all modules contained along with documentation and usage examples.
Executing automation
ansible-navigator run <playbook> will execute playbooks after downloading a default execution environment. To run without an execution environment, pass --ee false to the command.
Notice how the interface changes from the overview screen to a screen that now lists out the plays that are being executed.
Pressing the number that corresponds to the line number of the play you'd like to inspect brings you to a screen that shows the tasks running along with the current running task.
From here, any tasks can be inspected for additional information including any additional information regarding task failure.
If a more traditional real time view of execution is preferred, issue the :st command to watch execution.
What's next?
- The automation content navigator can be installed by RPM using the official Ansible Automation Platform documentation. If you are a Red Hat customer, you can visit the Ansible Automation Platform 2 landing page in the Red Hat Customer Portal that consolidates all of the documentation and guidance available to you.
- If you’re ready to get hands on, we have self-paced interactive labs available to explore Ansible Automation Platform 2.
- To learn more about new Ansible Automation Platform features and components, check out the updated product overview page on ansible.com. You can also consult our new interactive features guide.
- Make sure to catch up on announcements, demos, keynotes and more great content from AnsibleFest 2021, which is now available on-demand.
- Please reach out to your local Red Hat representative to assist your organization in getting started with Ansible Automation Platform 2.