DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Accelerating AI Inference With TensorRT
  • AI's Dilemma: When to Retrain and When to Unlearn?
  • Getting Started With GenAI on BigQuery: A Step-by-Step Guide
  • Transforming AI-Driven Data Analytics with DeepSeek: A New Era of Intelligent Insights

Trending

  • How to Use AWS Aurora Database for a Retail Point of Sale (POS) Transaction System
  • GitHub Copilot's New AI Coding Agent Saves Developers Time – And Requires Their Oversight
  • Monolith: The Good, The Bad and The Ugly
  • Navigating Change Management: A Guide for Engineers
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. Automation, Ansible, AI

Automation, Ansible, AI

Learn about how Ansible is bringing AI tools to your Integrated Development Environment to make your automation coding experience simpler, smoother, and more efficient.

By 
Vidyasagar (Sarath Chandra) Machupalli FBCS user avatar
Vidyasagar (Sarath Chandra) Machupalli FBCS
DZone Core CORE ·
Jun. 27, 23 · Tutorial
Likes (8)
Comment
Save
Tweet
Share
8.4K Views

Join the DZone community and get the full member experience.

Join For Free

Today, we are living in the world of artificial intelligence (AI). With Generative AI, writing code has become simpler. Coding is not about linting, formatting, and debugging anymore. 

In this article, you will learn about how Ansible is bringing AI tools to your Integrated Development Environment to make your automation coding experience simpler, smoother, and more efficient. 

What is Ansible?

Simply put, Ansible built is a simple IT automation tool that helps you in provisioning infrastructure, install software, and supports application automation through advanced workflows. 

Ansible automation can be used to automate daily tasks, improve security and compliance, patch systems, and share automation across your entire organization. Ansible allows you to automate z/OS applications and IT infrastructure as part of your enterprise automation strategy using a proven and consistent approach.

Ansible + AI

Ansible Lightspeed with IBM Watson Code Assistant, a new generative AI service for Ansible automation, was announced at Red Hat Summit and AnsibleFest 2023. Ansible Lightspeed with IBM Watson Code Assistant helps you to create Ansible code more efficiently. The tool that is available as a Visual Code Extension reads plain English entered by the developer, and then it interacts with IBM watsonx foundation models to generate code recommendations for automation tasks that are then used to create Ansible Playbooks. 

Ansible Lightspeed with IBM Watson Code Assistant in action

Ansible Lightspeed with IBM Watson Code Assistant in action

How to Setup and Getting Started

  1. Install the Ansible VSCode extension by Red Hat 
  2. Follow the instructions documented here to configure the extension to enable Ansible Lightspeed.
  3. Once successfully installed and configured, you should see a tab at the bottom, as shown in the image below

Ansible Lightspeed training matches

Ansible Lightspeed training matches

Write the Name of the Task To Generate Ansible

  1. Create a new Ansible playbook called ping.yml. 
  2. Add a new Ansible task with a name in plain English, like "Test ping with a register" or "HTTP PUT request to create a new object"
  3. You should see an Ansible module recommendation. Hit Tab, and the code will be inserted. You can further build on the Ansible code that is generated.Generating code with Ansible Light speed
Generating code with Ansible Light speed

     For Ansible yaml code snippets, check my code repository — https://github.com/VidyasagarMSC/ansible-yaml-snippets

Sample Ping Ansible Code

YAML
 
---
- name: Ping test
  hosts: machines
  gather_facts: false
  tasks:
    - name: Test ping
      ansible.builtin.ping:
      register: ping_result
    - name: Print register information from the previous task
      ansible.builtin.debug:
        var: ping_result


HTTP PUT Ansible Task Generated Using Ansible Lightspeed

YAML
 
- name: HTTP PUT request with JSON object
      ansible.builtin.uri:
        url: "{{ url }}"
        method: PUT
        body: "{{ body }}"
        headers:
          Accept: application/json
          Authorization: Bearer {{ token_permission }}
        validate_certs: false
      register: result
      changed_when: false
      become: true


An open and free technical preview is available to the users. Check the announcement here. 

What's Next

Explore Ansible Lightspeed, and if you have any queries, feel free to contact me on Twitter or LinkedIn. Don't forget to LIKE this post and star my Ansible yaml snippets repository on GitHub.

AI Ansible (software) Machine learning

Opinions expressed by DZone contributors are their own.

Related

  • Accelerating AI Inference With TensorRT
  • AI's Dilemma: When to Retrain and When to Unlearn?
  • Getting Started With GenAI on BigQuery: A Step-by-Step Guide
  • Transforming AI-Driven Data Analytics with DeepSeek: A New Era of Intelligent Insights

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!