Ansible Lightspeed with IBM watsonx

The Playbook I Never Wrote

I needed to automate Azure VM provisioning with specific networking, security groups, managed disks, and monitoring configuration. Total complexity: 300+ lines of YAML across 15 tasks.

Estimated time: 4-6 hours of writing, testing, and debugging.

Instead, I opened Ansible Lightspeed, typed this in natural language:

Create an Azure VM with:
- Size: Standard_D4s_v3
- OS: Ubuntu 22.04
- Managed disk: Premium SSD 128GB
- Network: existing vnet, new subnet
- NSG: allow SSH from corporate IP range
- Install monitoring agent
- Configure backup policy

Lightspeed generated a complete, production-ready playbook in 45 seconds. I reviewed it, made minor adjustments, ran it - perfect execution on the first try.

Time saved: 4 hours. This article teaches you how to leverage AI-powered automation with Ansible Lightspeed.

What You'll Learn

  • Ansible Lightspeed architecture and capabilities

  • Setting up Lightspeed with AAP

  • Natural language to automation code

  • Context-aware suggestions

  • Content source attribution

  • Best practices for AI-assisted automation

  • Real-world productivity gains

What is Ansible Lightspeed?

Ansible Lightspeed is an AI-powered code assistant built on IBM watsonx Code Assistant, specifically trained on Ansible content. It provides:

Core Capabilities

How It's Different from GitHub Copilot

Feature
Ansible Lightspeed
GitHub Copilot

Training Data

Ansible-specific content

General code

Context Awareness

Understands AAP concepts

Generic suggestions

Content Sources

Certified Content, Galaxy

Public GitHub repos

Attribution

Shows source + confidence

No attribution

Integration

Native AAP integration

VS Code extension

Architecture

spinner

Installation

Step 1: Install VS Code Extension

Step 2: Configure Lightspeed

Step 3: Authenticate

Step 4: Verify Connection

Using Lightspeed

Natural Language Task Generation

Example 1: AWS EC2 Instance

Natural Language Input:

Lightspeed Generated Code:

Example 2: Database Backup

Natural Language Input:

Lightspeed Generated Code:

Context-Aware Suggestions

Lightspeed understands your playbook context and suggests relevant next steps.

Your Playbook:

Lightspeed Suggests:

Module Parameter Completion

You Type:

Lightspeed Suggests:

Real-World Use Cases

Use Case 1: Multi-Cloud Provisioning

Request:

Generated Playbook Structure:

Use Case 2: Kubernetes Cluster Setup

Request:

Generated Playbook:

Use Case 3: Security Compliance Automation

Request:

Generated Playbook:

Content Source Attribution

Lightspeed shows where suggestions come from:

Best Practices

1. Be Specific in Requests

2. Review and Validate

3. Combine with Manual Expertise

4. Use for Documentation

Productivity Metrics

My Experience (3 Months with Lightspeed)

Troubleshooting

Lightspeed Not Suggesting

Irrelevant Suggestions

Slow Performance

Key Takeaways

βœ… Ansible Lightspeed accelerates automation development with AI βœ… Natural language describes tasks, Lightspeed generates code βœ… Context-aware suggestions understand your playbook intent βœ… Content attribution shows sources and confidence levels βœ… 60-70% time savings on playbook development βœ… Improved code quality with best practices built-in βœ… Learning accelerator for new modules and patterns

What's Next

The next article covers integrating Ansible Automation Platform with external systems - ServiceNow, GitLab CI/CD, monitoring tools, and ChatOps platforms.


Next Article: Integrating AAP with External Systems β†’


Part of the Ansible Automation Platform 101 Series

Last updated