Breadcrumb

  1. Red Hat Interactive Learning Portal
  2. Ansible Automation learning
  3. Get started with the Ansible Visual Studio Code extension
  4. Develop automation for Red Hat Ansible Automation Platform using a feature-branch

Get started with the Ansible Visual Studio Code extension

Take a guided walkthrough of the Ansible extension for Visual Studio Code (VS Code).

Now that your team is creating Ansible playbooks intended for use in Red Hat Ansible Automation Platform, you can use a Git repository and merge to ‘main’ when ready. How do you test in Ansible Automation Platform without breaking your Project for your teammates? Use your own Project!

Alternatively, you enable “branch override” in the project settings. Then, make a copy of a job template and set your feature-branch on your new job template. Using the feature-project method below is preferred, however, because it keeps your project separate from the team’s project.

In this lesson, you will:

  • Learn how to branch Projects for testing in Ansible Automation Platform

Prerequisites

Creating Projects

Since we’re already deep within Ansible Automation Platform using VS code extensions and Playbooks, we should navigate within it to branch our projects.

  1. Copy the team shared project.
  2. Select Duplicate project from the Projects list, as shown in Figure 1.

    Project list page in Ansible Automation platform screen with the 'duplicate project' button highlighted.
    Figure 1: Screenshot of the Ansible Automation Platform project list page, highlighting the “duplicate project” button.
  3. Edit your new feature-project:
    1. Change the name to something unique. For example, append the feature branch name to the project name, or prepend your initials.
    2. Set the project’s SCM branch to your feature branch, as shown in Figure 2.

      Edit project screen in Ansible Automation Platform showing Name and Source control branch fields highlighted.
      Figure 2: Screenshot of the Ansible Automation Platform project details page, highlighting the new project name and the source control branch field.
  4. If your feature includes changes to an inventory, then copy the inventory used by your job templates, and rename your copy.
  5. If your inventory uses an inventory source pointed to your team project, edit the inventory source in your new inventory and point it to your feature-project.
  6. Create job templates in your feature-project. These job templates will pull the feature-branch.

Day-to-day developing

Now that you have your templates set to pull feature-branches as needed, there are several things you can do to use it effectively during your regular work processes.

Next steps

Previous resource
Execute Ansible playbooks and integrated version control