Develop automation content in your workspace
The Ansible development tools are installed as part of the Ansible extension in the Ansible development workspace. You can use Ansible development tools to scaffold directories for automation content in your repository.
Using the Ansible extension ensures that best practices for directory structure are met.
Red Hat recommends that you create only one collection per repository, so that each collection has a clear, specific purpose. This approach promotes reusability, as each collection is a self-contained unit of content. A one-to-one relationship between a collection and its repository also improves manageability by simplifying dependency management, maintenance, and release cycles.
Create collections and playbooks in your Ansible development workspace
Use the Ansible extension in VS Code to use Ansible development tools to scaffold directories and files for your automation content. You can use Red Hat Ansible Lightspeed with IBM watsonx Code Assistant to help you write playbooks, and ansible-lint to debug them.
About this task
Procedure
Edit and debug automation content in your Ansible development workspace
You can continue to work in an existing workspace. Workspaces that are inactive might be paused due to an administrator-set timeout to free up resources. However, they will automatically relaunch when you select them from the OpenShift Dev Spaces dashboard.
About this task
Procedure
Execute playbooks in your Ansible development workspace
Execute your playbooks efficiently using the integrated Ansible extension within the VS Code environment of your workspace.
About this task
Procedure
You cannot use execution environments in Ansible development workspaces. Do not use ansible-navigator to execute playbooks.
Share your work
Share your automation content and collaborate with colleagues by working together from a single shared Git repository and submitting pull requests.
About this task
Procedure
- To contribute to a colleague’s project, request the URL for the Git repository that corresponds to your colleague’s Ansible development workspace.
- Launch a workspace using the repository URL that your colleague shared.
- Work within a new git branch and contribute to your colleague’s repository by creating a merge or pull request.