{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/16146","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/16146/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/16146/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/16146/events","html_url":"https://github.com/ansible/ansible/issues/16146","id":158659162,"number":16146,"title":"raw module not working for Cisco Routers","user":{"login":"analogbyte","id":4604331,"avatar_url":"https://avatars.githubusercontent.com/u/4604331?v=3","gravatar_id":"","url":"https://api.github.com/users/analogbyte","html_url":"https://github.com/analogbyte","followers_url":"https://api.github.com/users/analogbyte/followers","following_url":"https://api.github.com/users/analogbyte/following{/other_user}","gists_url":"https://api.github.com/users/analogbyte/gists{/gist_id}","starred_url":"https://api.github.com/users/analogbyte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/analogbyte/subscriptions","organizations_url":"https://api.github.com/users/analogbyte/orgs","repos_url":"https://api.github.com/users/analogbyte/repos","events_url":"https://api.github.com/users/analogbyte/events{/privacy}","received_events_url":"https://api.github.com/users/analogbyte/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-06T11:46:29Z","updated_at":"2016-06-06T16:41:32Z","closed_at":null,"body":"<!--- Verify first that your issue/request is not already reported in GitHub -->\r\n\r\n##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - Bug Report\r\n\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible 2.1.0.0\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### CONFIGURATION\r\n<!---\r\nMention any settings you have changed/added/removed in ansible.cfg\r\n(or using the ANSIBLE_* environment variables).\r\n-->\r\nNone relating to SSH.\r\n\r\n##### OS / ENVIRONMENT\r\n<!---\r\nMention the OS you are running Ansible from, and the OS you are\r\nmanaging, or say “N/A” for anything that is not platform-specific.\r\n-->\r\nA fresh virtual env.\r\n\r\n##### SUMMARY\r\n<!--- Explain the problem briefly -->\r\nThe `raw` Module fails to connect via SSH under unknown circumstances. Executing the debug messages of Ansible directly works though. It works on routers with more modern SSH versions.\r\n\r\n##### STEPS TO REPRODUCE\r\n<!---\r\nFor bugs, show exactly how to reproduce the problem.\r\nFor new features, show how the feature would be used.\r\n-->\r\nExecute command with the `raw` Module, even consider the `executable` advice from  #16054:\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```\r\nnaegele@librenms0:~$ ansible all -i some-router.company.net, -m raw -a 'executable=\"\" show int desc' -vvv\r\nNo config file found; using defaults\r\n<some-router.company.net> ESTABLISH SSH CONNECTION FOR USER: None\r\n<some-router.company.net> SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/naegele/.ansible/cp/ansible-ssh-%h-%p-%r -tt some-router.company.net 'show int desc'\r\nsome-router.company.net | UNREACHABLE! => {\r\n    \"changed\": false,\r\n    \"msg\": \"Failed to connect to the host via ssh.\",\r\n    \"unreachable\": true\r\n}\r\n```\r\nCopying the command from above into the shell directly:\r\n```\r\nnaegele@librenms0:~$ ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/neuner/.ansible/cp/ansible-ssh-%h-%p-%r -tt some-router.company.net 'show int desc'\r\n\r\n\r\nMon Jun  6 12:55:17.543 CEST\r\n\r\nInterface          Status      Protocol    Description\r\n--------------------------------------------------------------------------------\r\nLo0                up          up          ***\r\n<snip>\r\nTe0/1/0/2          admin-down  admin-down\r\nTe0/1/0/3          up          up          ***\r\n```\r\n<!--- You can also paste gist.github.com links for larger files -->\r\n\r\n##### EXPECTED RESULTS\r\n<!--- What did you expect to happen when running the steps above? -->\r\nIt should work in either case.\r\n\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->\r\nIt only works when working around ansible by pasting the command directly. However, both attemps look the same in the routers log:\r\n<!--- Paste verbatim command output between quotes below -->\r\n```\r\nRP/0/RSP0/CPU0:some-router#RP/0/RSP0/CPU0:Jun  6 13:43:30 CEST:\r\nSSHD_[65888]: %SECURITY-SSHD-4-WARNING_LOGIN : The requested term-type\r\n'screen' is not supported\r\nRP/0/RSP0/CPU0:Jun  6 13:43:31 CEST: SSHD_[65888]:\r\n%SECURITY-SSHD-6-INFO_SUCCESS_COMMAND : Successfully authenticated user\r\n'naegele' from '2001::ffff' on 'vty1'(cipher 'aes128-cbc', mac\r\n'hmac-md5', command 'show int desc')\r\n\r\n\r\n\r\nRP/0/RSP0/CPU0:some-router#RP/0/RSP0/CPU0:Jun  6 13:43:40 CEST:\r\nSSHD_[65888]: %SECURITY-SSHD-4-WARNING_LOGIN : The requested term-type\r\n'screen' is not supported\r\nRP/0/RSP0/CPU0:Jun  6 13:43:40 CEST: SSHD_[65888]:\r\n%SECURITY-SSHD-6-INFO_SUCCESS_COMMAND : Successfully authenticated user\r\n'naegele' from '2001::ffff' on 'vty1'(cipher 'aes128-cbc', mac\r\n'hmac-md5', command 'show int desc')\r\n```\r\nSetting `TERM=vt100` clears the warning from the Cisco's log, but does not help otherwise.\r\n\r\nAgain, note that it works on a router with a more recent version of sshd.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/224015377","html_url":"https://github.com/ansible/ansible/issues/16146#issuecomment-224015377","issue_url":"https://api.github.com/repos/ansible/ansible/issues/16146","id":224015377,"user":{"login":"alikins","id":15162,"avatar_url":"https://avatars.githubusercontent.com/u/15162?v=3","gravatar_id":"","url":"https://api.github.com/users/alikins","html_url":"https://github.com/alikins","followers_url":"https://api.github.com/users/alikins/followers","following_url":"https://api.github.com/users/alikins/following{/other_user}","gists_url":"https://api.github.com/users/alikins/gists{/gist_id}","starred_url":"https://api.github.com/users/alikins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alikins/subscriptions","organizations_url":"https://api.github.com/users/alikins/orgs","repos_url":"https://api.github.com/users/alikins/repos","events_url":"https://api.github.com/users/alikins/events{/privacy}","received_events_url":"https://api.github.com/users/alikins/received_events","type":"User","site_admin":false},"created_at":"2016-06-06T16:41:32Z","updated_at":"2016-06-06T16:41:32Z","body":"@bcoca Possibly related to https://github.com/ansible/ansible/pull/16085 ?\r\n(though the failure is different, and this issue seems to depend on router/ssh versions)."}}
{"actor":{"display_login":"alikins"}}