如何成功使用snow_record?
How to use snow_record succesfully?
有人在 ansible 2.5 中尝试 snow_record 吗?当我尝试 运行:
---
- name: executue sth
hosts: localhost
connection: local
gather_facts: no
ignore_errors: True
tasks:
- name: update an incident
snow_record:
username: test
password: test2
instance: dev9999
state: present
number: CHG0064887
data:
work_notes : "Been working all day on this thing."
我遇到错误:
{
"_ansible_parsed": false,
"_ansible_no_log": false,
"module_stderr": "/usr/lib/python2.7/site-packages/pysnow/client.py:129: DeprecationWarning: `query` is deprecated and will be removed in a future release. Please use `resource()` instead.\n \"Please use `resource()` instead.\" % inspect.stack()[1][3], DeprecationWarning)\nTraceback (most recent call last):\n File \"/tmp/ansible_XM2VJD/ansible_module_snow_record.py\", line 331, in <module>\n main()\n File \"/tmp/ansible_XM2VJD/ansible_module_snow_record.py\", line 328, in main\n run_module()\n File \"/tmp/ansible_XM2VJD/ansible_module_snow_record.py\", line 317, in run_module\n except pysnow.UnexpectedResponse as e:\nAttributeError: 'module' object has no attribute 'UnexpectedResponse'\n",
"changed": false,
"module_stdout": "",
"rc": 1,
"msg": "MODULE FAILURE"
}
顺便说一句,我必须自己安装 pysnow 我以为一旦我升级到 ansible 2.5,所有要求都会自动安装。
在 github 报告后发现如果您的实例名称 xyz.service-now.com 您必须将 xyz 作为实例名称放入您的 yaml 文件
有人在 ansible 2.5 中尝试 snow_record 吗?当我尝试 运行:
---
- name: executue sth
hosts: localhost
connection: local
gather_facts: no
ignore_errors: True
tasks:
- name: update an incident
snow_record:
username: test
password: test2
instance: dev9999
state: present
number: CHG0064887
data:
work_notes : "Been working all day on this thing."
我遇到错误:
{
"_ansible_parsed": false,
"_ansible_no_log": false,
"module_stderr": "/usr/lib/python2.7/site-packages/pysnow/client.py:129: DeprecationWarning: `query` is deprecated and will be removed in a future release. Please use `resource()` instead.\n \"Please use `resource()` instead.\" % inspect.stack()[1][3], DeprecationWarning)\nTraceback (most recent call last):\n File \"/tmp/ansible_XM2VJD/ansible_module_snow_record.py\", line 331, in <module>\n main()\n File \"/tmp/ansible_XM2VJD/ansible_module_snow_record.py\", line 328, in main\n run_module()\n File \"/tmp/ansible_XM2VJD/ansible_module_snow_record.py\", line 317, in run_module\n except pysnow.UnexpectedResponse as e:\nAttributeError: 'module' object has no attribute 'UnexpectedResponse'\n",
"changed": false,
"module_stdout": "",
"rc": 1,
"msg": "MODULE FAILURE"
}
顺便说一句,我必须自己安装 pysnow 我以为一旦我升级到 ansible 2.5,所有要求都会自动安装。
在 github 报告后发现如果您的实例名称 xyz.service-now.com 您必须将 xyz 作为实例名称放入您的 yaml 文件