**Hi. New to Ansible and the ServiceNow ITSM. The question is simple. My playbook fails. It is supposed to use this Help Desk + Automation collection. That webpage has examples. But they do not have any information about my trial ServiceNow instance (usually a Help Desk hostname, a username and a password). I have those three, but when I try to insert them inside the playbooks servicenow.itsm.change_request_task module, I immdeiately get this error ““missing required arguments: host found in instance””. So, it doesnt like it. Yet, if you refer to the README of the ITSM collection , it clearly states it needs the “host” and other data to conenct. But I just have no idea WHERE to insert the three instance parameters into this playbook so it creates a change request in my trial ServiceNow instance. Thx.*.
---
- name: Sample playbook
hosts: localhost
gather_facts: true
tasks:
- name: Create a change task
servicenow.itsm.change_request_task:
host: https://dev336605.service-now.com
username: redacted
password: redacted
configuration_item: Rogue Squadron Launcher
change_request_number: CHG0000001
type: planning
state: open
assigned_to: fred.luddy
assignment_group: robot.embedded
short_description: Implement collision avoidance
description: "Implement collision avoidance based on the newly installed TOF sensor arrays."
on_hold: true
hold_reason: "Waiting for a report from the hardware team"
planned_start_date: 2025-04-30 08:00:00
planned_end_date: 2025-05-21 16:00:00
other:
approval: approved
Output:
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/ansible_admin/.ansible/tmp/ansible-tmp-1746023277.5948503-202571-238420869672502/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"assigned_to": "fred.luddy",
"assignment_group": "robot.embedded",
"assignment_group_id": null,
"change_request_id": null,
"change_request_number": "CHG0000001",
"change_request_task_mapping": null,
"close_code": null,
"close_notes": null,
"configuration_item": "Rogue Squadron Launcher",
"configuration_item_id": null,
"description": "Implement collision avoidance based on the newly installed TOF sensor arrays.",
"hold_reason": "Waiting for a report from the hardware team",
"host": "https://dev336605.service-now.com",
"instance": {
"access_token": null,
"api_path": "api/now",
"client_id": null,
"client_secret": null,
"custom_headers": null,
"grant_type": null,
"host": null,
"password": null,
"refresh_token": null,
"timeout": null,
"username": null,
"validate_certs": true
},
"number": null,
"on_hold": true,
"other": {
"approval": "approved"
},
"password": "xFWb%1a*c6UO",
"planned_end_date": "2021-07-21T16:00:00",
"planned_start_date": "2021-07-15T08:00:00",
"short_description": "Implement collision avoidance",
"state": "open",
"sys_id": null,
"type": "planning",
"username": "aes.creator"
}
},
"msg": "missing required arguments: host found in instance"
}
PLAY RECAP **********************************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0