1

我尝试使用 juniper_junos_software 模块在 SRX550 上安装 12.3X48-D70,当它成功安装并重新启动设备时,由于“无处理程序”错误,任务返回失败。

剧本:

- name: Upgrade Juniper devices
  juniper_junos_software:
    host: "{{ inventory_hostname }}"
    local_package: "junos-srxsme-12.3X48-D70.3-domestic.tgz"
    reboot: yes
    version: "12.3X48-D70.3"
    user: user
    passwd: "{{ secret }}"
    port: 22
  ignore_errors: True
  register: junos_upgrade
  when: junos_before|success

详细输出:

TASK [code_upgrade : Upgrade Juniper devices] ***********************************************************
task path: /etc/ansible/new_test/.git/dev/code_upgrade/roles/code_upgrade/tasks/main2.yml:13
fatal: [lab-3]: FAILED! => {
    "changed": false,
    "module_stderr": "No handlers could be found for logger \"ncclient.transport.session\"\nTraceback (most recent call last):\n  File \"/tmp/ansible_0fR5rt/ansible_module_juniper_junos_software.py\", line 747, in <module>\n    main()\n  File \"/tmp/ansible_0fR5rt/ansible_module_juniper_junos_software.py\", line 743, in main\n    junos_module.exit_json(**results)\n  File \"/tmp/ansible_0fR5rt/ansible_modlib.zip/ansible/module_utils/juniper_junos_common.py\", line 792, in exit_json\n  File \"/tmp/ansible_0fR5rt/ansible_modlib.zip/ansible/module_utils/juniper_junos_common.py\", line 1327, in close\n  File \"/usr/lib/python2.7/site-packages/jnpr/junos/device.py\", line 1317, in close\n    self._conn.close_session()\n  File \"/usr/lib/python2.7/site-packages/ncclient/manager.py\", line 162, in wrapper\n    return self.execute(op_cls, *args, **kwds)\n  File \"/usr/lib/python2.7/site-packages/ncclient/manager.py\", line 232, in execute\n    raise_mode=self._raise_mode).request(*args, **kwds)\n  File \"/usr/lib/python2.7/site-packages/ncclient/operations/session.py\", line 28, in request\n    return self._request(new_ele(\"close-session\"))\n  File \"/usr/lib/python2.7/site-packages/ncclient/operations/rpc.py\", line 343, in _request\n    raise TimeoutExpiredError('ncclient timed out while waiting for an rpc reply.')\nncclient.operations.errors.TimeoutExpiredError: ncclient timed out while waiting for an rpc reply.\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE",
    "rc": 1

该错误在设备启动重新启动并脱机后不久出现。我对任何其他瞻博网络模块都没有这个问题。

我正在运行 Ansible 2.4.2、junos-eznc 2.1.8、python 2.7.5,Juniper.junos 角色是 2.1.0

4

1 回答 1

1

有人已经向 Junos 的开发人员报告了此类问题,您似乎遇到了错误https://github.com/Juniper/ansible-junos-stdlib/pull/361https://github.com/Juniper/py- junos-eznc/issues/651

但是,该修复程序存在于ansible-junos-stdlib(您拥有的那个)的 2.1.0 版本中,所以我不清楚这是同一个错误还是另一个密切相关的错误。

解决此问题的最佳方法是联系开发人员在 Github 上报告问题,确认这是相同的错误或其他错误并进行修复。

于 2018-08-03T06:27:25.333 回答