Q&A
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"'