Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

适用于 Junos OS 的 Ansible 故障排除摘要

表 1 列出了使用 Ansible 管理瞻博网络设备时可能遇到的一些常见错误。对于每个问题,该表都提供了一个参考,其中包含有关错误和解决问题的潜在解决方案的其他信息。但是,每个环境都是独一无二的,建议的解决方案可能并非在所有情况下都有效。

表 1:适用于 Junos OS 的 Ansible 错误
常规问题 示例错误 参考

Junos PyEZ
(junos-eznc)库错误

"msg": "junos-eznc (aka PyEZ) >= 2.6.0 is required for this module. However, junos-eznc does not appear to be currently installed."

排除 Ansible 模块的 Junos PyEZ (junos-eznc) 安装错误

Ansible 收集和模块解析错误

ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

ERROR! couldn't resolve module/action 'juniper.device.facts'. This often indicates a misspelling, missing collection, or incorrect module path.

在管理 Junos 设备时,排除 Ansible 收集和模块错误

外部连接插件错误
AttributeError: 'Connection'

(适用于 Ansible ansible-core 版本 >= 2.12.9)

AttributeError: 'Connection' object has no attribute 'nonetype'

不设置_sub_plugin触发错误的外部连接插件

无法访问的主机

UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ", "unreachable": true}

unknown command: /bin/sh\r\n

故障排除失败或无效的连接错误

未知主机
(ConnectUnknownHostError)

"msg": "Unable to make a PyEZ connection: ConnectUnknownHostError(dc1a.example.net)"

对未知主机错误进行故障排除

连接被拒绝
(ConnectRefusedError)

"msg": "Unable to make a PyEZ connection: ConnectRefusedError(dc1a.example.net)"

拒绝连接错误疑难解答

身份验证错误
(ConnectAuthError)

"msg": "Unable to make a PyEZ connection: ConnectAuthError(dc1a.example.net)"

ConnectAuthError 问题疑难解答

conn_type 错误

AttributeError: 'JuniperJunosModule' object has no attribute 'conn_type'

属性conn_type错误疑难解答

配置超时错误
(TimeoutExpiredError)

ncclient.operations.errors.TimeoutExpiredError: ncclient timed out while waiting for an rpc reply

配置超时错误疑难解答

配置锁定错误
(LockError)

"msg": "Unable to open the configuration in exclusive mode: LockError(severity: error, bad_element: None, message: configuration database modified)"

"msg": "Unable to open the configuration in exclusive mode: LockError(severity: error, bad_element: lock-configuration, message: permission denied)"

配置锁定错误疑难解答

配置加载错误
(ConfigLoadError)

FAILED! => {"changed": false, "msg": "Failure loading the configuraton: ConfigLoadError(severity: error, bad_element: scripts, message: error: permission denied)"}

配置加载错误疑难解答

配置提交错误
(CommitError)

FAILED! => {"changed": false, "msg": "Unable to commit configuration: CommitError(edit_path: None, bad_element: None, message: error: remote lock-configuration failed on re0\n\nnote: consider using 'commit synchronize force' to\nterminate remote edit sessions and force the commit)"}

提交错误疑难解答