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.
- 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.
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.
Here are a few common automation scenarios enabled by this collection:
- Incident Management: Automatically create, update, and query incidents during CI/CD pipelines or event-driven automation.
- Change Management: Trigger change requests and manage their lifecycle in coordination with deployment processes.
- Configuration Item (CI) Updates: Automate the creation and update of CIs in CMDB during system provisioning.
- Service Catalog Integration: Provision and manage items from the service catalog through Ansible playbooks.
- Attachment Handling: Upload or retrieve documents from records to streamline workflows.
Name | Description |
---|---|
servicenow.itsm.now | Inventory source for ServiceNow table records. |
Name | Description |
---|---|
api | Manage ServiceNow POST, PATCH and DELETE requests |
api_info | Manage ServiceNow GET requests |
attachment_info | Download attachment using sys_id |
attachment_upload | Upload attachment to a table |
change_request | Manage ServiceNow change requests |
change_request_info | List ServiceNow change requests |
change_request_task | Manage change request tasks |
change_request_task_info | List change request tasks |
configuration_item | Manage configuration items |
configuration_item_batch | Manage configuration items in batch |
configuration_item_info | List configuration items |
configuration_item_relations | Manage CI relationships |
configuration_item_relations_info | List CI relationships |
incident | Manage incidents |
incident_info | List incidents |
problem | Manage problems |
problem_info | List problems |
problem_task | Manage problem tasks |
problem_task_info | List problem tasks |
service_catalog | Manage service catalogs |
service_catalog_info | List service catalogs |
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 }}"
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 Release | Collection Release | EOL |
---|---|---|
Yokohama | 2.9.0+ | TBA |
Xanadu | 2.7.0+ | TBA |
Washington DC | 2.5.0+ | TBA |
Vancouver | 2.5.0 - 2.8.0 | Q2 2025 |
Utah | 2.1.0 - 2.8.0 | Q2 2025 |
Tokyo | 2.1.0 - 2.6.1 | Q2 2024 |
We welcome contributions! Open an issue or a pull request on the GitHub repository:
Guidelines:
Join us on:
- IRC:
#ansible-community
on irc.libera.chat - Ansible Forum
More: Ansible Community Guide and Communication
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
# 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
This collection is licensed under the GNU General Public License v3.0 or later.
See: https://www.gnu.org/licenses/gpl-3.0.txt