Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Boost Ansible developer experience with OpenShift Dev Spaces

October 2, 2023
Kathryn Yetter Andrew Becker
Related topics:
Automation and managementDeveloper ToolsIDEsKubernetes
Related products:
Developer ToolsRed Hat OpenShift Dev SpacesRed Hat Ansible Automation Platform

Share:

    Developer experience for Ansible developers can vary significantly depending on the tooling they can access, the operating system they use, and the technical background they have. These variations have real-world implications for the quality of automation that is developed. With poor, untested code, automation adoption can suffer, stall, and eventually fail.

    Imagine the ideal Ansible development experience: there should be seamless access to testing tools, linters, a user-friendly integrated development environment (IDE) experience, and integration with source control. All too often, there are administrative or technical blockers to creating this ideal environment, and that carries significant repercussions.

    Field observations

    There are two types of workarounds teams use to move towards this ideal development environment. Each tries to get the user access to standard tooling but also comes with its own drawbacks.

    First, linters and testing tools are sometimes moved to a pipeline, like GitLab Runners or GitHub Actions. This approach creates a slower feedback loop, which makes development harder. While pipelines are an essential part of the CI/CD process, they shouldn't be the first place a developer realizes their automation, such as a playbook, has a linting error.

    Another common workaround is pairing an IDE, often Visual Studio Code (VS Code), with an Ansible-equipped system through extensions like Remote - SSH, Windows Subsystem for Linux (WSL), Docker Desktop, or Podman. This requires varying degrees of overhead and opens the door to individual workstation discrepancies. In other words, "it worked on my machine." On top of this, acquiring and maintaining these tools in some highly regulated environments is almost impossible due to technical and administrative obstacles.

    A new solution

    The focus of this article is an opinionated development environment that gives users instant feedback, allows for easy testing, and is standard for all developers in an enterprise: a literal easy button for folks looking to get started. Red Hat OpenShift Dev Spaces recently released an Ansible workspace sample—an exciting step in an ongoing effort to create a smooth Ansible developer experience. This sample workspace is currently a community effort, and this post highlights its advantages.

    Red Hat OpenShift users can test this out by installing the OpenShift Dev Spaces Operator (version 3.7.0 or later). For those of you who want to follow along at home, you can try it for yourself in the no-cost Developer Sandbox for Red Hat OpenShift.

    Upon opening OpenShift Dev Spaces, you can select Ansible as your sample workspace, as shown in Figure 1.

    A screen shot of the create workspace page in OpenShift DevSpaces that shows a Ansible square
    Figure 1: Upon opening the OpenShift Dev Spaces operator, we can see an Ansible easy button for workspace creation.

    Inside the sample Ansible workspace, there is the Dev Spaces IDE. Figure 2 shows the IDE with a playbook open in the top right frame. The playbook has a highlighted error from the Ansible extension and an open terminal to show installed Ansible.

    A screenshot of the Dev Spaces IDE, with an Ansible playbook open that shows text highlighting, and a terminal displaying the Ansible version command output
    Figure 2: The playbook has text highlighting provided by the VSCode Ansible extension. In the terminal below, we can see the Ansible CLI tool is installed.

    Once you have the sample running in your browser, you can check out the following rich feature set provided in the workspace.

    Powerful, modern IDE

    OpenShift Dev Spaces supplies a VS Code-like editing experience that many developers find productive. It is highly configurable, with an extension library to support any development workflow. The Ansible VSCode extension is present in this IDE, which allows for instant syntax checking, linting, and autocomplete to accelerate development. You can add additional extensions for YAML syntax checking, Python development support, and many other capabilities.

    Ansible CLI tools

    Inside the Ansible workspace is a full developer toolset. The Ansible Dev Spaces sample comes loaded with the following CLI tools needed for development:

    • ansible-navigator
    • ansible-playbook
    • ansible-vault
    • Molecule
    • ansible-lint
    • ansible-builder

    A user can run syntax checks, Ansible ad hoc commands, and playbooks from the environment, something that is currently impossible for some developers.

    Ease of testing

    The Molecule testing tool is provided in the sample workspace. Furthermore, running on OpenShift allows for the possibility of spinning up containers to test against in the cluster. There's even an example in the workspace, in /collections/.../roles/backup_file, where Molecule uses a custom driver to spin up a container, runs the playbook against it, runs tests, and then spins down. Developers can now access the ephemeral infrastructure to test the automation they are developing.

    Consistent environment

    Each workspace is centrally configured, removing the configuration drift that happens in environments with local workstations. This consistency gives developers confidence that if they get a clean run, so will their teammates. It also cuts down on-boarding time for new team members; with one click, they can have a setup that is identical across their enterprise.

    Takeaways

    The environment where users develop Ansible automation matters. Without proper testing and linting tools, development is much harder and slower than it needs to be. Over time, we've seen a number of solutions that users have implemented out of a need for this kind of tooling, which come with their own complexities and pain points.

    However, as illustrated in this article, using OpenShift Dev Spaces as an Ansible development environment provides many advantages that help ease the process. The standardized environment removes setup time and workstation discrepancies and allows for dynamic and streamlined testing that utilizes OpenShift's strengths. While this is still an emerging, community-supported solution, you can apply these concepts as a baseline for increasing the overall velocity and experience of your automation journey.

    You can try out these capabilities today using the no-cost Developer Sandbox for Red Hat OpenShift.

    OSZAR »
    Last updated: August 12, 2024

    Related Posts

    • What's new in Ansible Automation Platform 2.4

    • CodeReady Workspaces scales up, is now Red Hat OpenShift Dev Spaces

    • How to create a workspace via Try in Dev Spaces extension

    • How to run VS Code with OpenShift Dev Spaces

    • How to deploy a MSSQL database using Ansible Vault

    Recent Posts

    • How to use pipelines for AI/ML automation at the edge

    • What's new in network observability 1.8

    • LLM Compressor: Optimize LLMs for low-latency deployments

    • How to set up NVIDIA NIM on Red Hat OpenShift AI

    • Leveraging Ansible Event-Driven Automation for Automatic CPU Scaling in OpenShift Virtualization

    What’s up next?

    Choosing an Automation Tool feature image

    Why automate? Which tool do I use? This e-book dives into various automation options, how they work, what to automate, and the benefits of each tool.

    OSZAR »
    Get the e-book
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue

    OSZAR »