Create and launch an Ansible development workspace
An administrator installs Red Hat OpenShift Dev Spaces. After installation, developers can use the provided OpenShift Dev Spaces dashboard to create Ansible development workspaces that include a web-based version of VS Code.
Authentication Copy linkLink copied!
Ansible dev spaces must be able to authenticate with your Git provider.
- If your organization has integrated Git OAuth authentication with Ansible dev spaces, you do not need to configure authentication between OpenShift Dev Spaces and your Git provider.
- If your organization has not set up OAuth authentication, you must generate personal access tokens for authentication between OpenShift Dev Spaces and your Git provider.
Configure Git personal access token authentication Copy linkLink copied!
You must create a personal access token (PAT) in your Git provider, and add it to OpenShift Dev Spaces to enable access to your repositories from your Ansible development workspace.
About this task Copy linkLink copied!
Procedure Copy linkLink copied!
Create a Git repository for an Ansible development workspace Copy linkLink copied!
To launch an Ansible development workspace, you must provide a link to a Git repository that defines the development environment. The repository also stores the automation content you create in Ansible dev spaces.
About this task Copy linkLink copied!
Procedure Copy linkLink copied!
- If your administrator provides an example repository for your team, fork the repository to create your own copy.
- If you do not have access to an example repository, you must create your own repository.
- Create a directory for your new repository and use
git initto initialize it as a Git repository. - Add a
devfile.yamlfile to the repository to define the Ansible dev spaces image that you want to use for your Ansible development workspace. See Creating a devfile for Ansible development workspaces. - Add a
.code-workspacefile to the repository to specify the VS Code extensions for your Ansible development workspace. See Creating a.code-workspacefile for Ansible development workspaces.
- Create a directory for your new repository and use
Create a devfile for an Ansible development workspace Copy linkLink copied!
To ensure your Ansible development workspace launches with the correct Ansible dev spaces image, you must add a devfile to your git repository. A devfile is a YAML file that defines the development environment for a project in Red Hat OpenShift Dev Spaces.
About this task Copy linkLink copied!
Procedure Copy linkLink copied!
Create a code-workspace file for an Ansible development workspace Copy linkLink copied!
To configure VS Code extensions that are included in your Ansible development workspace, you must add a .code-workspace JSON file to your git repository.
About this task Copy linkLink copied!
Procedure Copy linkLink copied!
Launch an Ansible dev spaces workspace Copy linkLink copied!
Launch your Ansible development workspace by providing the URL for your prepared Git repository in the OpenShift Dev Spaces dashboard. This opens your VS Code environment in a browser.
Before you begin Copy linkLink copied!
- Your administrator has provided a URL for a OpenShift Dev Spaces dashboard.
- You have prepared a git repository that contains the
devfile.yamland.code-workspacefiles that define the Ansible development workspace configuration.
