如何成功使用snow_record?

时间:2018-05-28 01:25:08

标签: python ansible python-module

有没有人在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,所有的要求都会自动安装。

1 个答案:

答案 0 :(得分:0)

在github报告之后,事实证明,如果您的实例名称为xyz.service-now.com,则必须将yyz作为实例名称放入yaml文件中