Using Ansible plug-ins for Red Hat Developer Hub
Use Ansible plug-ins for Red Hat Developer Hub
Abstract
Preface
Thank you for your interest in Red Hat Ansible Automation Platform. Ansible Automation Platform is a commercial offering that helps teams manage complex multi-tier deployments by adding control, knowledge, and delegation to Ansible-powered environments.
This guide describes how to use Ansible plug-ins for Red Hat Developer Hub. This document has been updated to include information for the latest release of Ansible Automation Platform.
Providing feedback on Red Hat documentation
If you have a suggestion to improve this documentation, or find an error, you can contact technical support at https://access.redhat.com to open a request.
Ansible plug-ins for Red Hat Developer Hub is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
Chapter 1. Using the Ansible plug-ins
You can use Ansible plug-ins for Red Hat Developer Hub (RHDH) to learn about Ansible, create automation projects, and access opinionated workflows and tools to develop and test your automation code. From the Red Hat Developer Hub UI, you can navigate to your Ansible Automation Platform instance, where you can configure and run automation jobs.
This document describes how to use the Ansible plug-ins for Red Hat Developer Hub. It presents a worked example of developing a playbook project for automating updates to your firewall configuration on RHEL systems.
1.1. Optional requirement
The Ansible plug-ins for Red Hat Developer Hub link to Learning Paths on the Red Hat developer portal, developers.redhat.com/learn.
To access the Learning Paths, you must have a Red Hat account and you must be able to log in to developers.redhat.com.
1.2. Dashboard navigation
When you log in to Red Hat Developer Hub (RHDH), the main RHDH menu and dashboard are displayed.
To view the dashboard for Ansible plug-ins for Red Hat Developer Hub, click Ansible in the Red Hat Developer Hub navigation panel.

The plug-in dashboard illustrates the steps you need to take from learning about Ansible to deploying automation jobs from Ansible Automation Platform:
- Overview displays the main dashboard page.
- Learn provides links to resources curated by Red Hat that introduce you to Ansible and provide step-by-step examples to get you started. For more information, see Learning about Ansible.
- Discover existing collections links to private automation hub, if configured in the plug-ins, or to automation hub hosted on the Red Hat Hybrid Cloud Console. Automation hub stores existing collections and execution environments that you can use in your projects. For more information, see Discovering existing collections.
- Create creates new projects in your configured Source Control Management platforms such as GitHub. For more information, see Creating a project.
- Develop links you to OpenShift Dev Spaces, if configured in the Ansible plug-ins installation. OpenShift Dev Spaces provides on-demand, web-based Integrated Development Environments (IDEs), where you can develop automation content. For more information, see Developing projects.
- Operate connects you to Ansible Automation Platform, where you can create and run automation jobs that use the projects you have developed. For more information, see Setting up a controller project to run your playbook project.
1.3. Learning about Ansible
To learn more about getting started with automation, click Learn from the Overview page of the plug-in dashboard. The Learn page provides the following options for learning:
Learning Paths lists a curated selection of learning tools hosted on developers.redhat.com that guide you through the foundations of working with Ansible, the Ansible VS Code extension, and using YAML.
You can select other Ansible learning paths from the Useful links section.
- Labs are self-led labs that are designed to give you hands-on experience in writing Ansible content and using Ansible development tools.
1.4. Discovering existing collections
From the Overview page in the Ansible plug-ins dashboard on Red Hat Developer Hub, click Discover Existing Collections.
The links in this pane provide access to the source of reusable automation content collections that you configured during plug-in installation.
If you configured private automation hub when installing the plug-in, you can click Go to Automation Hub to view the collections and execution environments that your enterprise has curated.
If you did not configure a private automation hub URL when installing the plug-in, the Discover existing collection pane provides a link to Red Hat automation hub on console.redhat.com. You can explore certified and validated Ansible content collections on this site.
1.5. Creating a project
Prerequisite
- Ensure you have the correct access (RBAC) to view the templates in Red Hat Developer Hub. Ask your administrator to assign access to you if necessary.
Procedure:
- Log in to your Red Hat Developer Hub UI.
-
Click the Ansible
A
icon in the Red Hat Developer Hub navigation panel. - Navigate to the Overview page.
- Click Create.
- Click Create Ansible Git Project. The Available Templates page opens.
- Click Create Ansible Playbook project.
In the Create Ansible Playbook Project page, enter information for your new project in the form.
You can see sample values for this form in the Example project.
Field Description Source code repository organization name or username
The name of your source code repository username or organization name
Playbook repository name
The name of your new Git repository
Playbook description (Optional)
A description of the new playbook project
Playbook project’s collection namespace
The new playbook Git project creates an example collection folder for you. Enter a value for the collection namespace.
Playbook project’s collection name
The name of the collection
Catalog Owner Name
The name of the Developer Hub catalog item owner. This is a Red Hat Developer Hub field.
Source code repository organization name or username
The name of your source code repository username or organization name
Playbook repository name
The name of your new Git repository
Playbook description (Optional)
A description of the new playbook project
System (Optional)
This is a Red Hat Developer Hub field
NoteCollection namespaces must follow Python module naming conventions. Collections must have short, all lowercase names. You can use underscores in the collection name if it improves readability.
For more information, see the Ansible Collection naming conventions documentation.
- Click Review.
1.6. Viewing your projects
To view the projects that you have created in the plug-in, navigate to the Overview page for the Ansible plug-in and click My Items.
1.7. Developing projects
1.7.1. Developing projects on Dev Spaces
OpenShift Dev Spaces is not included with your Ansible Automation Platform subscription or the Ansible plug-ins for Red Hat Developer Hub.
The plug-ins provide context-aware links to edit your project in Dev Spaces.
The Dev Spaces instance provides a default configuration that installs the Ansible VS Code extension and provides the Ansible command line tools. You can activate Ansible Lightspeed in the Ansible VS Code extension. For more information, refer to the Red Hat Ansible Lightspeed with IBM watsonx Code Assistant User Guide.
1.7.2. Executing automation tasks in Dev Spaces
The default configuration for Dev Spaces provides access to the Ansible command line tools.
To execute an automation task in Dev Spaces from the VSCode user interface, right-click a playbook name in the list of files and select Run Ansible Playbook via ansible-navigator run or Run playbook via ansible-playbook.

1.8. Setting up a controller project to run your playbook project
Procedure
- The Ansible plug-ins provide a link to Ansible Automation Platform.
- Log in to your Red Hat Developer Hub UI.
-
Click the Ansible
A
icon in the Red Hat Developer Hub navigation panel. Click Operate to display a link to your Ansible Automation Platform instance.
If automation controller was not included in your plug-in installation, a link to the product feature page is displayed.
Click Go to Ansible Automation Platform to open your platform instance in a new browser tab.
Alternatively, if your platform instance was not configured during the Ansible plug-in installation, navigate to your automation controller instance in a browser and log in.
- Log in to automation controller.
- Create a project in Ansible Automation Platform for the GitHub repository where you stored your playbook project. Refer to the Projects chapter of the Automation controller user guide.
- Create a job template that uses a playbook from the project that you created. Refer to the Job Templates chapter of the Automation controller user guide.
Chapter 2. Providing feedback in the Ansible plug-ins
The Ansible plug-ins provide a feedback form where you can suggest new features and content, as well as general feedback.
-
Click the Ansible
A
icon in the Red Hat Developer Hub navigation panel. Click the Feedback icon to display the feedback form.
- Enter the feedback you want to provide.
- Tick the I understand that feedback is shared with Red Hat checkbox.
- Click Submit.
To ensure that Red Hat receives your feedback, exclude your Red Hat Developer Hub URL in any browser ad blockers or privacy tools.
Chapter 3. Example: Automate Red Hat Enterprise Linux firewall configuration
This example demonstrates how the Ansible plug-ins can help Ansible users of all skill levels create quality Ansible content.
As an infrastructure engineer new to Ansible, you have been tasked to create a playbook to configure a Red Hat Enterprise Linux (RHEL) host firewall.
The following procedures show you how to use the Ansible plug-ins and Dev Spaces to develop a playbook.
3.1. Learning more about playbooks
The first step is to learn more about Ansible playbooks using the available learning paths.
-
Click the Ansible
A
icon in the Red Hat Developer Hub navigation panel. - Click Learn and select the Getting Started with Ansible Playbooks learning path. This redirects you to the Red Hat Developer website.
- If you are prompted to log in, create a Red Hat Developer account, or enter your details.
- Complete the learning path.
3.2. Discovering existing Ansible content for RHEL system roles
Red Hat recommends that you use trusted automation content that has been tested and approved by Red Hat or your organization.
Automation hub is a central repository for discovering, downloading, and managing trusted content collections from Red Hat and its partners. Private automation hub provides an on-premise solution for managing content collections.
-
Click on the Ansible
A
icon in the Red Hat Developer Hub navigation panel. - Click Discover existing collections.
Click Go to Automation Hub.
- If private automation hub has been configured in the Ansible plug-ins, you are redirected to your PrivateHubName instance.
- If private automation hub has not been configured in the Ansible plug-ins installation configuration, you will be redirected to the Red Hat Hybrid Console (RHCC) automation hub.
In this example, you are redirected to the RHCC automation hub.
- If you are prompted to log in, provide your Red Hat Customer Portal credentials.
Filter the collections with the
rhel firewall
keywords.The search returns the
rhel_system_roles
collection.
The RHEL System Roles collection contains certified Ansible content that you can reuse to configure your firewall.
3.3. Create a new playbook project to configure a firewall
Use the Ansible plug-ins to create a new Ansible Playbook project.
-
Click the Ansible
A
icon in the Red Hat Developer Hub navigation panel. - From the Create dropdown menu on the landing page, select Create Ansible Git Project.
- Click Choose in the Create Ansible Playbook Project software template.
- Fill in the following information in the Create Ansible Playbook Project page:
Field | Required | Description | Example value |
---|---|---|---|
Source code repository organization name or username | Yes | The name of your source code repository username or organization name. |
|
Playbook repository name | Yes | The name of your new Git repository. |
|
Playbook description | No | A description of the new playbook project. |
|
Playbook project’s collection namespace | Yes | The new playbook Git project creates an example collection folder for you. Enter a value for the collection namespace. |
|
Playbook project’s collection name | Yes | This is the name of the example collection. |
|
Catalog Owner Name | Yes | The name of the Developer Hub catalog item owner. It is a Red Hat Developer Hub field. |
|
System | No | This is a Red Hat Developer Hub field. |
|
- Click Review.
- Click Create to provision your new playbook project.
- Click Open in catalog to view your project.
3.4. Creating a new playbook to automate the firewall configuration
Create a new playbook and use the RHEL System Role collection to automate your Red Hat Enterprise Linux firewall configuration.
- In your Dev Spaces instance, click → .
-
Enter
firewall.yml
for the filename and click OK to save it in the root directory. Add the following lines to your
firewall.yml
file:--- - name: Open HTTPS and SSH on firewall hosts: rhel become: true tasks: - name: Use rhel system roles to allow https and ssh traffic vars: firewall: - service: https state: enabled permanent: true immediate: true zone: public - service: ssh state: enabled permanent: true immediate: true zone: public ansible.builtin.include_role: name: redhat.rhel_system_roles.firewall
You can use Ansible Lightspeed with IBM watsonx Code Assistant from the Ansible VS Code extension to help you generate playbooks. For more information, refer to the Ansible Lightspeed with IBM watsonx Code Assistant User Guide.
3.5. Editing your firewall playbook project
The Ansible plug-ins integrate OpenShift Dev Spaces to edit your Ansible projects. OpenShift Dev Spaces provides on-demand, web-based Integrated Development Environments (IDEs).
Ansible Git projects provisioned using the Ansible plug-ins include best practice configurations for OpenShift Dev Spaces. These configurations include installing the Ansible VS Code extension and providing access from the IDE terminal to Ansible development tools, such as Ansible Navigator and Ansible Lint.
OpenShift Dev Spaces is optional and it is not required to run the Ansible plug-ins. It is a separate Red Hat product and it is not included in the Ansible Automation Platform or Red Hat Developer Hub subscription.
This example assumes that OpenShift Dev Spaces has been configured in the Ansible plug-ins installation.
Procedure
In the catalog item view of your playbook project, click Open Ansible project in OpenShift Dev Spaces.
A VS Code instance of OpenShift Dev Spaces opens in a new browser tab. It automatically loads your new Ansible Playbook Git project.