{"action":"closed","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/19109","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/19109/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/19109/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/19109/events","html_url":"https://github.com/ansible/ansible/issues/19109","id":194686603,"number":19109,"title":"module junos_netconf fails when ssh key has a passphrase","user":{"login":"ganeshnalawade","id":5292461,"avatar_url":"https://avatars.githubusercontent.com/u/5292461?v=3","gravatar_id":"","url":"https://api.github.com/users/ganeshnalawade","html_url":"https://github.com/ganeshnalawade","followers_url":"https://api.github.com/users/ganeshnalawade/followers","following_url":"https://api.github.com/users/ganeshnalawade/following{/other_user}","gists_url":"https://api.github.com/users/ganeshnalawade/gists{/gist_id}","starred_url":"https://api.github.com/users/ganeshnalawade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ganeshnalawade/subscriptions","organizations_url":"https://api.github.com/users/ganeshnalawade/orgs","repos_url":"https://api.github.com/users/ganeshnalawade/repos","events_url":"https://api.github.com/users/ganeshnalawade/events{/privacy}","received_events_url":"https://api.github.com/users/ganeshnalawade/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-09T20:13:50Z","updated_at":"2016-12-09T20:17:39Z","closed_at":"2016-12-09T20:17:39Z","body":"_From @msanabria on December 9, 2016 3:48_\n\n##### ISSUE TYPE\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\njunos_netconf\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.2.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\ndefault\r\n\r\n##### OS / ENVIRONMENT\r\n- Control node: \r\n  Fedora release 25 (Twenty Five)\r\n- Managed node: \r\n  Juniper ex2200-c-12t-2g\r\n  JUNOS Base OS boot [12.3R12.4]\r\n  JUNOS Base OS Software Suite [12.3R12.4]\r\n  JUNOS Kernel Software Suite [12.3R12.4]\r\n  JUNOS Crypto Software Suite [12.3R12.4]\r\n  JUNOS Online Documentation [12.3R12.4]\r\n  JUNOS Enterprise Software Suite [12.3R12.4]\r\n  JUNOS Packet Forwarding Engine Enterprise Software Suite [12.3R12.4]\r\n  JUNOS Routing Software Suite [12.3R12.4]\r\n  JUNOS Web Management [12.3R12.4]\r\n  JUNOS FIPS mode utilities [12.3R12.4]\r\n\r\n##### SUMMARY\r\nModule returns error msg: \"failed to connect to host.example.com:22\" when running junos_netconf module with the ssh_keyfile option if the ssh key is protected by a passphrase. Works without a passphrase or when using username/password authentication.\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\n1. Generate ssh keypair for user with a passphrase\r\n2. Configure ssh access to Juniper switch using ssh key for user.\r\n3. Confirm ssh access to switch from control node.\r\n4. Run example ansible command listed below.\r\n5. Note how module failed with above error.\r\n\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```\r\nansible all -i localhost, -m junos_netconf -a 'host=host.example.com state=present username=user ssh_keyfile=/home/user/.ssh/id_rsa transport=cli' -c local -vvvv\r\n```\r\n\r\n##### EXPECTED RESULTS\r\nExpected module to execute check successfully with a changed status of true or false.\r\n\r\n##### ACTUAL RESULTS\r\nModule failed with error.\r\n\r\n<!--- Paste verbatim command output between quotes below -->\r\n```\r\nUsing /etc/ansible/ansible.cfg as config file\r\nSet default localhost to localhost\r\nLoading callback plugin minimal of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/__init__.pyc\r\nUsing module file /usr/lib/python2.7/site-packages/ansible/modules/core/network/junos/junos_netconf.py\r\n<localhost> ESTABLISH LOCAL CONNECTION FOR USER: user\r\n<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p \"` echo $HOME/.ansible/tmp/ansible-tmp-1481254838.79-143601608977538 `\" && echo ansible-tmp-1481254838.79-143601608977538=\"` echo $HOME/.ansible/tmp/ansible-tmp-1481254838.79-143601608977538 `\" ) && sleep 0'\r\n<localhost> PUT /tmp/tmpFXh0og TO /home/user/.ansible/tmp/ansible-tmp-1481254838.79-143601608977538/junos_netconf.py\r\n<localhost> EXEC /bin/sh -c 'chmod u+x /home/user/.ansible/tmp/ansible-tmp-1481254838.79-143601608977538/ /home/user/.ansible/tmp/ansible-tmp-1481254838.79-143601608977538/junos_netconf.py && sleep 0'\r\n<localhost> EXEC /bin/sh -c '/usr/bin/python /home/user/.ansible/tmp/ansible-tmp-1481254838.79-143601608977538/junos_netconf.py; rm -rf \"/home/user/.ansible/tmp/ansible-tmp-1481254838.79-143601608977538/\" > /dev/null 2>&1 && sleep 0'\r\nlocalhost | FAILED! => {\r\n    \"changed\": false, \r\n    \"failed\": true, \r\n    \"invocation\": {\r\n        \"module_args\": {\r\n            \"auth_pass\": null, \r\n            \"authorize\": false, \r\n            \"host\": \"host.example.com\", \r\n            \"netconf_port\": 830, \r\n            \"password\": null, \r\n            \"port\": null, \r\n            \"provider\": null, \r\n            \"ssh_keyfile\": \"/home/user/.ssh/id_rsa\", \r\n            \"state\": \"present\", \r\n            \"timeout\": 10, \r\n            \"transport\": \"cli\", \r\n            \"username\": \"user\"\r\n        }, \r\n        \"module_name\": \"junos_netconf\"\r\n    }, \r\n    \"msg\": \"failed to connect to host.example.com:22\"\r\n}\r\n```\r\n\n\n_Copied from original issue: ansible/ansible-modules-core#5866_"}}
{"actor":{"display_login":"ganeshnalawade"}}