Ansible for Junos OSトラブルシューティングの概要

表1 は、 juniper.device Ansibleモジュールを使用してジュニパーネットワークスデバイスを管理する際に発生する可能性のある一般的なエラーを示しています。表には、各問題について、エラーと問題を解決するための考えられる解決策に関する追加情報が記載されたリファレンスが記載されています。ただし、環境はすべて固有であり、提案されたソリューションがすべてのケースで機能するとは限りません。

表1:Ansible for Junos OSエラー
一般的な問題 エラー例 資料

Junos PyEZ
(junos-eznc) ライブラリエラー

  • "msg": "junos-eznc is required but does not appear to be installed. It can be installed using 'pip install junos-eznc'"

AnsibleモジュールのJunos PyEZ(junos-eznc)インストールエラーのトラブルシューティング

Ansible収集およびモジュール解決エラー

  • ERROR! couldn't resolve module/action 'module-name'. This often indicates a misspelling, missing collection, or incorrect module path.

  • ERROR! no action detected in task. This often indicates a misspelled module name, 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}

接続の失敗、不明なコマンド、またはインタープリターが見つかりませんエラーのトラブルシューティング

モジュールインタプリタが見つかりません/不明なコマンド

  • [ERROR]: Task failed: Action failed: The module interpreter '/path/to/bin/python' was not found.

  • unknown command: /bin/sh\r\n

接続の失敗、不明なコマンド、またはインタープリターが見つかりませんエラーのトラブルシューティング

不明なホストまたはアドレスエラー

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

  • [WARNING]: Could not match supplied host pattern, ignoring: name

  • "msg": "[Errno -5] No address associated with hostname"

不明なホストエラーのトラブルシューティング

接続拒否またはソケットエラー

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

  • "msg": "Could not open socket to hostname:830"

接続拒否エラーとソケットエラーのトラブルシューティング

ホストネットワークOSエラー

  • Unable to automatically determine host network os. Please manually configure ansible_network_os value for this host

ホストネットワークOSエラーのトラブルシューティング

認証エラー

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

  • "msg": "AuthenticationException('Authentication failed.')"

認証エラーのトラブルシューティング

ホストまたはsock_fdの欠落エラー(junos_package)

  • [ERROR]: Task failed: You must provide either 'host' or 'sock_fd' value

モジュールの接続および認証パラメーターの提供

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)"}

コミットエラーのトラブルシューティング