Introduction

Autonomous industrial systems — factories, logistics networks, and supply chains becoming semi-autonomous through AI orchestration — are a defining 2026 trend. Deloitte reports enterprises deploying robot fleets and self-driving production flows. Ansible manages the IT/OT convergence: edge controllers, MES (Manufacturing Execution Systems), SCADA configuration, predictive maintenance pipelines, and supply chain orchestration.

Industrial Inventory

# inventory/factory.yml
all:
  children:
    production_line_1:
      children:
        plc_controllers:
          hosts:
            plc-weld-01: { ansible_host: 10.10.1.10, cell: welding }
            plc-asm-01: { ansible_host: 10.10.1.20, cell: assembly }
          vars:
            ansible_connection: local
            device_type: plc

        edge_gateways:
          hosts:
            edge-gw-01: { ansible_host: 10.10.2.10, zone: production }
            edge-gw-02: { ansible_host: 10.10.2.20, zone: quality }
          vars:
            ansible_user: operator
            edge_platform: ubuntu

        mes_servers:
          hosts:
            mes-01: { ansible_host: 10.10.3.10 }
          vars:
            mes_platform: ignition

    warehouse:
      hosts:
        wms-01: { ansible_host: 10.20.1.10 }
      vars:
        system_type: wms

    monitoring:
      hosts:
        scada-01: { ansible_host: 10.10.4.10 }

Edge Gateway Deployment

---
- name: Deploy industrial edge gateways
  hosts: edge_gateways
  become: true
  vars:
    mqtt_broker: mqtt.factory.internal
    data_buffer_size: 10000

  tasks:
    - name: Install industrial protocol stack
      ansible.builtin.package:
        name:
          - mosquitto
          - mosquitto-clients
          - python3-opcua
          - python3-modbus
        state: present

    - name: Configure MQTT bridge to cloud
      ansible.builtin.template:
        src: mosquitto-bridge.conf.j2
        dest: /etc/mosquitto/conf.d/bridge.conf
      notify: Restart Mosquitto

    - name: Deploy OPC-UA to MQTT connector
      ansible.builtin.template:
        src: opcua-connector.py.j2
        dest: /opt/edge/opcua-connector.py
        mode: "0755"

    - name: Deploy data collection service
      ansible.builtin.template:
        src: data-collector.service.j2
        dest: /etc/systemd/system/data-collector.service
      notify:
        - Reload systemd
        - Restart data collector

    - name: Configure local data buffer (offline resilience)
      ansible.builtin.template:
        src: data-buffer.conf.j2
        dest: /opt/edge/buffer.conf

    - name: Start edge services
      ansible.builtin.service:
        name: "{{ item }}"
        state: started
        enabled: true
      loop:
        - mosquitto
        - data-collector

  handlers:
    - name: Reload systemd
      ansible.builtin.systemd:
        daemon_reload: true
    - name: Restart Mosquitto
      ansible.builtin.service:
        name: mosquitto
        state: restarted
    - name: Restart data collector
      ansible.builtin.service:
        name: data-collector
        state: restarted

Predictive Maintenance Pipeline

- name: Deploy predictive maintenance system
  hosts: mes_servers
  become: true
  tasks:
    - name: Deploy time-series database (TimescaleDB)
      community.docker.docker_container:
        name: timescaledb
        image: timescale/timescaledb:latest-pg16
        state: started
        restart_policy: unless-stopped
        ports: ["5432:5432"]
        volumes:
          - /data/timescale:/var/lib/postgresql/data
        env:
          POSTGRES_PASSWORD: "{{ vault_db_password }}"
      no_log: true

    - name: Deploy ML prediction service
      community.docker.docker_container:
        name: predictive-maintenance
        image: "{{ predictive_maintenance_image }}"
        state: started
        ports: ["8080:8080"]
        env:
          DB_URL: "postgresql://pred:{{ vault_db_password }}@localhost:5432/maintenance"
          MODEL_PATH: /models/failure_predictor.onnx
          ALERT_WEBHOOK: "{{ alert_webhook_url }}"
        volumes:
          - /opt/models:/models:ro
      no_log: true

    - name: Deploy Grafana dashboards for maintenance
      community.docker.docker_container:
        name: grafana-factory
        image: grafana/grafana:latest
        state: started
        ports: ["3000:3000"]
        volumes:
          - /opt/grafana/dashboards:/var/lib/grafana/dashboards
          - /opt/grafana/provisioning:/etc/grafana/provisioning

    - name: Import factory floor dashboard
      ansible.builtin.copy:
        src: dashboards/factory-floor.json
        dest: /opt/grafana/dashboards/factory-floor.json

Supply Chain Orchestration

- name: Deploy supply chain visibility platform
  hosts: warehouse
  become: true
  tasks:
    - name: Deploy supply chain API
      community.docker.docker_container:
        name: supply-chain-api
        image: "{{ supply_chain_image }}"
        state: started
        ports: ["8443:8443"]
        env:
          DATABASE_URL: "{{ vault_db_url }}"
          ERP_ENDPOINT: "{{ erp_api_url }}"
          WMS_ENDPOINT: "{{ wms_api_url }}"
        volumes:
          - /opt/supply-chain/config:/app/config
      no_log: true

    - name: Configure inventory tracking
      ansible.builtin.template:
        src: inventory-tracking.yml.j2
        dest: /opt/supply-chain/config/tracking.yml

    - name: Set up automated reorder alerts
      ansible.builtin.cron:
        name: "Check inventory levels"
        minute: "*/15"
        job: >
          curl -s http://localhost:8443/api/inventory/check |
          python3 -c "import sys,json; d=json.load(sys.stdin);
          [print(f'LOW: {i[\"sku\"]} ({i[\"qty\"]})')
          for i in d if i['qty']<i['reorder_point']]"
          >> /var/log/inventory-alerts.log 2>&1

Network Segmentation (IT/OT)

- name: Enforce IT/OT network segmentation
  hosts: edge_gateways
  become: true
  tasks:
    - name: Configure firewall zones
      ansible.builtin.template:
        src: ot-firewall.rules.j2
        dest: /etc/iptables/rules.v4
      notify: Apply firewall

    - name: Restrict OT network access
      ansible.builtin.iptables:
        chain: FORWARD
        source: "{{ ot_network }}"
        destination: "{{ it_network }}"
        jump: DROP
        comment: "Block direct OT→IT traffic"

    - name: Allow only approved OT→IT flows
      ansible.builtin.iptables:
        chain: FORWARD
        source: "{{ ot_network }}"
        destination: "{{ item.dest }}"
        protocol: tcp
        destination_port: "{{ item.port }}"
        jump: ACCEPT
        comment: "Allow {{ item.service }}"
      loop:
        - { dest: "{{ mqtt_broker }}", port: 8883, service: "MQTT TLS" }
        - { dest: "{{ mes_server }}", port: 443, service: "MES API" }
        - { dest: "{{ ntp_server }}", port: 123, service: "NTP" }

  handlers:
    - name: Apply firewall
      ansible.builtin.command: iptables-restore /etc/iptables/rules.v4

Rolling Updates for Production Systems

- name: Rolling update production edge systems
  hosts: edge_gateways
  become: true
  serial: 1
  max_fail_percentage: 0

  pre_tasks:
    - name: Check production schedule
      ansible.builtin.uri:
        url: "http://{{ mes_server }}/api/schedule/current"
      register: schedule

    - name: Abort if production is running
      ansible.builtin.fail:
        msg: "Cannot update during active production"
      when: schedule.json.status == "running"

  tasks:
    - name: Update edge software
      ansible.builtin.apt:
        name: "{{ edge_packages }}"
        state: latest

    - name: Run system diagnostics
      ansible.builtin.command: /opt/edge/diagnostics.sh
      register: diag
      failed_when: "'FAIL' in diag.stdout"

  post_tasks:
    - name: Verify data flow restored
      ansible.builtin.uri:
        url: "http://localhost:8080/api/health"
      register: health
      until: health.status == 200
      retries: 12
      delay: 5

Conclusion

Autonomous industrial systems in 2026 merge IT and OT — and Ansible bridges both worlds. It deploys edge gateways with industrial protocol stacks (OPC-UA, Modbus, MQTT), manages predictive maintenance ML pipelines, orchestrates supply chain visibility platforms, enforces IT/OT network segmentation, and performs rolling updates during maintenance windows. The key pattern: treat factory floor devices like any infrastructure fleet — inventory them, configure them declaratively, update them safely with serial: 1 and production schedule awareness. Ansible's agentless model is ideal for constrained OT environments.