itsm

25Modules39Plugins

Overview

Description

Ansible Collection for interacting with ServiceNow ITSM

Readme

Ansible Collection for ServiceNow ITSM

The Ansible Collection for ServiceNow IT Service Management (ITSM) provides Ansible content that enables users to automate the management of ServiceNow ITSM processes such as incidents, change requests, service catalogs, configuration items, and more.

This collection is ideal for IT administrators, DevOps engineers, and automation specialists who work with ServiceNow and want to integrate its capabilities into their infrastructure automation workflows.

Requirements

  • Ansible-Core: >= 2.15.0
  • Python: With ansible-core, as listed for control nodes here
  • No additional Python libraries or external Ansible collections are required.
  • A ServiceNow instance and user credentials are required for module authentication.

Installation

Install the collection from Ansible Galaxy using:

ansible-galaxy collection install servicenow.itsm

Or include it in a requirements.yml file:

collections:
  - name: servicenow.itsm

To upgrade the collection to the latest version:

ansible-galaxy collection install servicenow.itsm --upgrade

To install a specific version:

ansible-galaxy collection install servicenow.itsm:==1.0.0

See the full guide on using Ansible collections for more.

Use Cases

Here are a few common automation scenarios enabled by this collection:

  1. Incident Management: Automatically create, update, and query incidents during CI/CD pipelines or event-driven automation.
  2. Change Management: Trigger change requests and manage their lifecycle in coordination with deployment processes.
  3. Configuration Item (CI) Updates: Automate the creation and update of CIs in CMDB during system provisioning.
  4. Service Catalog Integration: Provision and manage items from the service catalog through Ansible playbooks.
  5. Attachment Handling: Upload or retrieve documents from records to streamline workflows.

Inventory Plugins

NameDescription
servicenow.itsm.nowInventory source for ServiceNow table records.

Modules

NameDescription
apiManage ServiceNow POST, PATCH and DELETE requests
api_infoManage ServiceNow GET requests
attachment_infoDownload attachment using sys_id
attachment_uploadUpload attachment to a table
catalog_request_infoList ServiceNow catalog requests
catalog_requestManage ServiceNow catalog requests
change_requestManage ServiceNow change requests
change_request_infoList ServiceNow change requests
change_request_taskManage change request tasks
change_request_task_infoList change request tasks
catalog_request_taskManage ServiceNow catalog requests tasks
configuration_itemManage configuration items
configuration_item_batchManage configuration items in batch
configuration_item_infoList configuration items
configuration_item_relationsManage CI relationships
configuration_item_relations_infoList CI relationships
incidentManage incidents
incident_infoList incidents
problemManage problems
problem_infoList problems
problem_taskManage problem tasks
problem_task_infoList problem tasks
service_catalogManage service catalogs
service_catalog_infoList service catalogs

Example Usage

Using FQCN:

- name: Retrieve incidents by number
  servicenow.itsm.incident_info:
    instance:
      host: https://dev12345.service-now.com
      username: user
      password: pass
    number: INC0000039
  register: result

With collections keyword:

collections:
  - servicenow.itsm

tasks:
  - incident_info:
      instance:
        host: https://dev12345.service-now.com
        username: user
        password: pass
      number: INC0000039
    register: result

Using environment:

---
- name: Test SNOW with blocks
  hosts: localhost
  become: false
  gather_facts: false
  vars:
    sn_host: https://hostname.example.com
    sn_username: username
    sn_password: password
  tasks:
    - name: Perform several ServiceNow tasks with the same credentials
      block:
        - name: Create test incident with attachment
          servicenow.itsm.incident:
            caller: admin
            state: new
            short_description: Test incident
            impact: low
            urgency: low
          register: test_incident
      environment:
        SN_HOST: "{{ sn_host }}"
        SN_USERNAME: "{{ sn_username }}"
        SN_PASSWORD: "{{ sn_password }}"

Testing

This collection is tested with: - Ansible-Core >= 2.15.0 - Python, as specified for control nodes here - Supported ServiceNow versions according to the table below

Known exceptions or compatibility issues will be tracked via the GitHub Issues page.

ServiceNow ReleaseCollection ReleaseEOL
Yokohama2.9.0+TBA
Xanadu2.7.0+TBA
Washington DC2.5.0+TBA
Vancouver2.5.0 - 2.8.0Q2 2025
Utah2.1.0 - 2.8.0Q2 2025
Tokyo2.1.0 - 2.6.1Q2 2024

Contributing

We welcome contributions! Open an issue or a pull request on the GitHub repository: - https://github.com/ansible-collections/servicenow.itsm

Guidelines: - https://docs.ansible.com/ansible/devel/community/contributing_maintained_collections.html#contributing-maintained-collections

Join us on: - IRC: #ansible-community on irc.libera.chat - Ansible Forum

More: Ansible Community Guide and Communication

Support

Support is provided via: - GitHub issues: https://github.com/ansible-collections/servicenow.itsm/issues - Community channels listed above - Maintained versions are clearly indicated in the release table

Release Notes and Roadmap

Publishing New Version

# Sync with upstream
git checkout main && git pull && git fetch upstream && git merge upstream/main

# Prepare release
ansible-playbook scripts/prepare_release.yml --extra-vars "version=$VERSION"

# Push and open PR
git push --set-upstream origin prepare_$VERSION_release

# After PR is merged
git checkout main && git pull && git fetch upstream && git merge upstream/main
git tag -s $VERSION
git push upstream $VERSION

Related Information

License Information

This collection is licensed under the GNU General Public License v3.0 or later. See: https://www.gnu.org/licenses/gpl-3.0.txt

Certification

Product
Red Hat Ansible Automation Platform 2.4
Red Hat Ansible Automation Platform 2.5
DocumentationDependencies
No dependencies
There are currently no dependencies for this collection.
View in Automation Hub
Red Hat logoLinkedInYouTubeFacebookTwitter

Platforms

Products & services

Try, buy, sell

Help

About Red Hat Ecosystem Catalog

The Red Hat Ecosystem Catalog is the official source for discovering and learning more about the Red Hat Ecosystem of both Red Hat and certified third-party products and services.

We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2025 Red Hat