Skip to content

ansible-collections/servicenow.itsm

Ansible Collection for ServiceNow ITSM

The Ansible Collection for ServiceNow IT Service Management (ITSM) includes a variety of Ansible content to help automate the management of ServiceNow IT Service Management.

Releases and maintenance

Release Status Expected end of life
2 Maintained TBA
1 EOL September 2023

ServiceNow Platform Support

ServiceNow Release Collection Release Expected end of life
Washington DC 2.5.0+ TBA
Vancouver 2.5.0+ TBA
Utah 2.1.0+ TBA
Tokyo 2.1.0+ TBA

Ansible version compatibility

This collection has been tested against the following Ansible versions: >=2.9.10.

Python version compatibility

This collection requires Python 2.7 or greater.

Included content

Inventory plugins

Name Description
servicenow.itsm.now Inventory source for ServiceNow table records.

Modules

Name Description
servicenow.itsm.api Manage ServiceNow POST, PATCH and DELETE requests
servicenow.itsm.api_info Manage ServiceNow GET requests
servicenow.itsm.attachment_info a module that users can use to download attachment using sys_id
servicenow.itsm.attachment_upload Upload attachment to the selected table
servicenow.itsm.change_request Manage ServiceNow change requests
servicenow.itsm.change_request_info List ServiceNow change requests
servicenow.itsm.change_request_task Manage ServiceNow change request tasks
servicenow.itsm.change_request_task_info List ServiceNow change request tasks
servicenow.itsm.configuration_item Manage ServiceNow configuration items
servicenow.itsm.configuration_item_batch Manage ServiceNow configuration items in batch mode
servicenow.itsm.configuration_item_info List ServiceNow configuration item
servicenow.itsm.incident Manage ServiceNow incidents
servicenow.itsm.incident_info List ServiceNow incidents
servicenow.itsm.problem Manage ServiceNow problems
servicenow.itsm.problem_info List ServiceNow problems
servicenow.itsm.problem_task Manage ServiceNow problem tasks
servicenow.itsm.problem_task_info List ServiceNow problem tasks

Installing this collection

You can install the ServiceNow ITSM collection with the Ansible Galaxy CLI:

ansible-galaxy collection install servicenow.itsm

You can also include it in a requirements.yml file and install it with ansible-galaxy collection install -r requirements.yml, using the format:

---
collections:
  - name: servicenow.itsm

Using this collection

You can either call modules by their Fully Qualified Collection Namespace (FQCN), such as servicenow.itsm.incident_info:

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

or you can call modules by their short name if you list the servicenow.itsm collection in the playbook's collections keyword:

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

See Also:

Contributing to this collection

We welcome community contributions to this collection. If you find problems, please open an issue or create a PR against the ServiceNow ITSM collection repository. See Contributing to Ansible-maintained collections for more details.

You can also join us on:

See the Ansible Community Guide for details on contributing to Ansible.

See this page for a complete and up to date list of communication channels and their purposes.

Release notes

See the CHANGELOG.rst

Publishing New Version

Assuming your (local) repository has set origin to your GitHub fork and this repository is added as upstream:

Prepare the release:

  • Make sure your fork is up to date: git checkout main && git pull && git fetch upstream && git merge upstream/main.
  • Run ansible-playbook scripts/prepare_release.yml. The playbook tries to generate the next minor release automatically, but you can also set the version explicitly with --extra-vars "version=$VERSION". You will have to set the version explicitly when publishing a new major release.
  • Push the created release branch to your GitHub repo (git push --set-upstream origin prepare_$VERSION_release) and open a pull request for review.

Push the release:

  • After the PR has been merged, make sure your fork is up to date: git checkout main && git pull && git fetch upstream && git merge upstream/main.
  • Tag the release: git tag -s $VERSION
  • Push the tag: git push upstream $VERSION

Roadmap

More information

Licensing

GNU General Public License v3.0 or later.

See COPYING to see the full text.