Using Ansible plug-ins for Red Hat Developer Hub


Red Hat Ansible Automation Platform 2.4

Use Ansible plug-ins for Red Hat Developer Hub

Red Hat Customer Content Services

Abstract

This guide describes how to use Ansible plug-ins for Red Hat Developer Hub to learn about Ansible, explore curated collections, and create playbook projects.

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.

Important

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.

Ansible plug-in dashboard

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:

  1. Log in to your Red Hat Developer Hub UI.
  2. Click the Ansible A icon in the Red Hat Developer Hub navigation panel.
  3. Navigate to the Overview page.
  4. Click Create.
  5. Click Create Ansible Git Project. The Available Templates page opens.
  6. Click Create Ansible Playbook project.
  7. 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.

    FieldDescription

    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

    Note

    Collection 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.

  8. 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.

Run a playbook from VS Code

1.8. Setting up a controller project to run your playbook project

Procedure

  1. The Ansible plug-ins provide a link to Ansible Automation Platform.
  2. Log in to your Red Hat Developer Hub UI.
  3. Click the Ansible A icon in the Red Hat Developer Hub navigation panel.
  4. 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.

  5. 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.

  6. Log in to automation controller.
  7. 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.
  8. 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.

  1. Click the Ansible A icon in the Red Hat Developer Hub navigation panel.
  2. Click the Feedback icon to display the feedback form.

    Ansible plug-in feedback form
  3. Enter the feedback you want to provide.
  4. Tick the I understand that feedback is shared with Red Hat checkbox.
  5. Click Submit.
Note

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.

  1. Click the Ansible A icon in the Red Hat Developer Hub navigation panel.
  2. Click Learn and select the Getting Started with Ansible Playbooks learning path. This redirects you to the Red Hat Developer website.
  3. If you are prompted to log in, create a Red Hat Developer account, or enter your details.
  4. 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.

  1. Click on the Ansible A icon in the Red Hat Developer Hub navigation panel.
  2. Click Discover existing collections.
  3. 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.

  4. If you are prompted to log in, provide your Red Hat Customer Portal credentials.
  5. 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.

  1. Click the Ansible A icon in the Red Hat Developer Hub navigation panel.
  2. From the Create dropdown menu on the landing page, select Create Ansible Git Project.
  3. Click Choose in the Create Ansible Playbook Project software template.
  4. Fill in the following information in the Create Ansible Playbook Project page:
FieldRequiredDescriptionExample value

Source code repository organization name or username

Yes

The name of your source code repository username or organization name.

my_github_username

Playbook repository name

Yes

The name of your new Git repository.

rhel_firewall_config

Playbook description

No

A description of the new playbook project.

This playbook configures firewalls on Red Hat Enterprise Linux systems

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.

my_galaxy_username

Playbook project’s collection name

Yes

This is the name of the example collection.

rhel_firewall_config

Catalog Owner Name

Yes

The name of the Developer Hub catalog item owner. It is a Red Hat Developer Hub field.

my_rhdh_username

System

No

This is a Red Hat Developer Hub field.

my_rhdh_linux_system

  1. Click Review.
  2. Click Create to provision your new playbook project.
  3. 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.

  1. In your Dev Spaces instance, click FileNew File.
  2. Enter firewall.yml for the filename and click OK to save it in the root directory.
  3. 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
Note

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.

Note

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.

Legal Notice

Copyright © 2025 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.