Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

How to automate devices using the Ansible CIP collection

January 10, 2023
Josh Swanson
Related topics:
Automation and management
Related products:
Red Hat Ansible Automation Platform

    During the past few months, Red Hat has collaborated with Rockwell Automation to bring the Red Hat Ansible Automation Platform into a new realm: The control of embedded devices via the Common Industrial Protocol (CIP). This article introduces the value and uses of Ansible Automation Platform's CIP collection, now available in Ansible's Galaxy repository. The development site for this collection is on GitHub.

    Lacking CIP, control over industrial devices has generally been performed by connecting the firmware and programs for a programmable logic controller (PLC) from a laptop over a USB cable. The procedure requires human intervention and isn't particularly scalable.

    Our collaboration with Rockwell Automation established the viability of an Ansible Automation Platform project in this space and brought its power to a whole new class of devices.

    Using configuration files to control devices

    At Ansiblefest 2022, we showcased a demo case from Rockwell Automation, using the Ansible Automation Platform to tell the PLC to toggle an LED light and control the speed and direction of a motor via a variable frequency drive. Figure 1 shows how the computing components connect inside the demo case, containing the LED and a round motor.

    Computer parts and motors are connected within a case.
    Figure 1: Computer parts and motors are connected within a case.

    Figure 2 shows the execution flow of the architecture. Ansible Automation Platform is the automation controller.

    The execution flow of the architecture.
    Figure 2: Ansible Automation Platform controls the PLC, which controls the drive and ultimately the motor.

    The behavior of the motor and LED is automated by adjusting tags (variables) within the PLC program using the new CIP collection. Traditional YAML and natural-language playbooks can make changes against devices. For example, the following code block instructs the PLC to start spinning the motor forward at 1Hz:

    - name: Start motor slowly
      community.cip.ensure_tags:
        tags:
          - name: "Start" # Set ‘Start' to true
            value: True
          - name: "Stop" # Set ‘Stop' to false
            value: False
          - name: "MotorSetPoint" # Set the frequency of the motor
            value: 100
          - name: "isForward" # Set the direction
            value: True

    Figure 3 shows the illuminated LED, and the motor has rotated a bit.

    The light is illuminated and the motor has rotated.
    Figure 3: The light is illuminated and the motor has rotated.

    After the task runs, the frequency shows on the drive.

    Another task can adjust this tag again as follows:

    - name: Speed up
      community.cip.ensure_tags:
        tags:
          - name: "MotorSetPoint"
            value: 5000

    The new tag sets the drive to 50Hz, and the motor spins far more rapidly (Figure 4).

    The round motor is spinning rapidly.
    Figure 4: The round motor is spinning rapidly.

    Real-world use cases for CIP collection

    While adjusting the motor's revolutions per minute (RPMs) and toggling an LED might be a toy application, the CIP collection can manage industrial devices in production environments.

    In the future, PLCs (and ultimately, the industrial systems they control) will become far more composable. Industrial device management can exploit some of the best practices from the DevOps world, such as infrastructure as code and GitOps, to enable agility at a scale not achievable today. New firmware versions that address vulnerabilities can be rolled out globally in a matter of minutes without requiring human intervention at every industrial site. Rapid prototyping can enable the development and testing of PLC programs to add features and functionality, which are immediately deployed to existing manufacturing lines. Also, manufacturing lines can be rapidly reconfigured and redeployed to manufacture new products without taking the line down for an extended period to reconfigure the control systems manually.

    The CIP collection development team

    Developing the CIP collection was a major team effort. We welcome your feedback. Comment below if you have questions, or you can get involved by visiting the GitHub repo issues page. We offer special thanks to the following collection authors from Rockwell Automation and Red Hat:

    • Aaron Neustedter, Rockwell Automation
    • Adam Miller, Red Hat
    • Chris Santiago, Red Hat
    • Matthew Sandoval, Red Hat
    • Josh Swanson, Red Hat
    • Chad Ferman, Red Hat

    Related Posts

    • Using Ansible Galaxy Roles in Ansible Playbook Bundles

    • How to install VMs and Ansible Automation Platform on Mac M1

    • Example of using Ansible to update Container Native Storage

    • How we automate everything at Red Hat Open Innovation Labs

    Recent Posts

    • Trusted software factory: Building trust in the agentic AI era

    • Build a zero trust AI pipeline with OpenShift and RHEL CVMs

    • Red Hat Hardened Images: Top 5 benefits for software developers

    • How EvalHub manages two-layer Kubernetes control planes

    • Tekton joins the CNCF as an incubating project

    What’s up next?

    Automation IT

    Automating IT operations lets you do more with what you have, freeing up teams to work on projects that deliver greater business value. In An IT executive's guide to automation, you'll discover the benefits of a long-term transformative automation strategy, explore automation adoption best practices, and more.

    Download the e-book
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    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
    © 2026 Red Hat

    Red Hat legal and privacy links

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

    Chat Support

    Please log in with your Red Hat account to access chat support.