Page
Troubleshoot Ansible content with Ansible Navigator
Now that you have tested a sample Ansible role, it's time to troubleshoot your Ansible content.
Ansible Navigator
Apart from Molecule, ansible-lint, ansible-playbook, and ansible-galaxy, the Ansible Dev Spaces sample comes loaded with ansible-navigator. Ansible Navigator is a command-line tool and a text-based user interface for creating, reviewing, running, and troubleshooting Ansible content, which includes:
- Inventories
- Playbooks
- Collections
- Documentation
To launch ansible-navigator, select Terminal -> Run Task -> devfile -> Ansible-Navigator: Start ansible-navigator and it will open in the Terminal view (Figure 19).
You can use ansible-navigator to explore the current Ansible configuration. Just type :config
in the terminal where ansible-navigator is running, then press Enter (Figure 20).
You can learn more about ansible-navigator by watching a demo of the interface on YouTube or reading the documentation.
Clean Molecule testing resources
After completing your work, you still have a running test pod in your user namespace, but there's no need to worry about it. OpenShift Dev Spaces will automatically remove it before shutting down the workspace. To remove the running test pod, the workspace runs a 6.Molecule: reset the test pod back to a fresh instance command that executes molecule destroy
under the hood. This command is marked as preStop
command in the devfile.yaml
file (Figure 21).
Conclusion
Red Hat OpenShift Dev Spaces is emerging as an invaluable asset in the realm of Ansible development environments. Its wealth of user-friendly features significantly enhances the development and testing experience for Ansible roles. The implementation of a standardized environment not only reduces setup time, but also bridges the gap between different workstations, which promotes a seamless collaborative workflow. This cohesive environment fosters dynamic testing practices and capitalizes on the inherent strengths of the OpenShift platform, culminating in a powerful and efficient development ecosystem.