質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ansible

Ansibleは、Python で書かれたサーバーの設定を管理するための 構成管理ツールです。

Q&A

0回答

797閲覧

ansibleでLinuxサーバを踏み台としてCisco機器へios_commandを実行したい

773283

総合スコア0

Ansible

Ansibleは、Python で書かれたサーバーの設定を管理するための 構成管理ツールです。

1グッド

1クリップ

投稿2022/03/31 15:55

ansible version: 2.7.8を使用しています。
ansibleでLinuxサーバを踏み台としてCisco機器へios_commandを実行したいのですが、
LinuxサーバからCisco機器へは接続できているように見えます。(sh usersで確認)

結果的にはTimeoutとなり、デバッグログでの「persistent connection idle timeout triggered」が解消できなくて困っております。
※Troubleshooting Guideを参照し、ANSIBLE_PERSISTENT_CONNECT_TIMEOUTを5分と伸ばしても同様でした。

足りないパラメータ、そのバージョンでは無理、バグ、などご教授いただければ幸いです。

(Debug Log)

2022-04-01 00:07:54,059 p=30293 u=root | paramiko [xxx.xxx.xxx.xxx] Switch to new keys ...
2022-04-01 00:07:54,081 p=30293 u=root | paramiko [xxx.xxx.xxx.xxx] userauth is OK
2022-04-01 00:07:54,092 p=30293 u=root | paramiko [xxx.xxx.xxx.xxx] Authentication (password) successful!
2022-04-01 00:07:54,096 p=30293 u=root | paramiko [xxx.xxx.xxx.xxx] [chan 0] Max packet in: 32768 bytes
2022-04-01 00:07:54,098 p=30293 u=root | paramiko [xxx.xxx.xxx.xxx] [chan 0] Max packet out: 4096 bytes
2022-04-01 00:07:54,098 p=30293 u=root | paramiko [xxx.xxx.xxx.xxx] Secsh channel 0 opened.
2022-04-01 00:07:54,101 p=30293 u=root | paramiko [xxx.xxx.xxx.xxx] [chan 0] Sesch channel 0 request ok
2022-04-01 00:07:54,104 p=30293 u=root | paramiko [xxx.xxx.xxx.xxx] [chan 0] Sesch channel 0 request ok
2022-04-01 00:08:54,649 p=30281 u=root | persistent connection idle timeout triggered, timeout value is 60 secs.
See the timeout setting options in the Network Debug and Troubleshooting Guide.
2022-04-01 00:08:54,752 p=30293 u=root | paramiko [xxx.xxx.xxx.xxx] [chan 0] EOF sent (0)
2022-04-01 00:08:54,764 p=30293 u=root | paramiko [xxx.xxx.xxx.xxx] EOF in transport thread
2022-04-01 00:08:54,766 p=30281 u=root | shutdown complete
2022-04-01 00:08:54,849 p=30268 u=root | fatal: [xxx.xxx.xxx.xxx]: FAILED! => {
"changed": false,
"msg": "socket_path does not exist or cannot be found.\nSee the socket_path issue catergory in Network Debug and Troubleshooting Guide"
}

※xxx.xxx.xxx.xxxはCisco機器のIPアドレスとなります。

(main.yaml)

yaml

1- hosts: test 2 gather_facts: no 3 vars_files: 4 - auth.yml 5 6 tasks: 7 - name: show int 8 ios_command: 9 commands: 10 - "sh int fa0" 11 register: result 12 13 - name: Output 14 debug: var=result

(auth.yml)

yaml

1ansible_user: xxxx 2ansible_password: xxxx 3ansible_connection: network_cli 4ansible_network_os: ios 5ansible_become: yes 6ansible_become_method: enable 7ansible_become_password: xxxx 8ansible_ssh_common_args: '-o StrictHostKeyChecking=no ProxyCommand="sshpass -p xxxx ssh -W %h:%p -q user@Linux"'
endy👍を押しています

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問