{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3304","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3304/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3304/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3304/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/3304","id":142682352,"number":3304,"title":"Wrong requests message version for NX-API.","user":{"login":"joelwking","id":8416404,"avatar_url":"https://avatars.githubusercontent.com/u/8416404?v=3","gravatar_id":"","url":"https://api.github.com/users/joelwking","html_url":"https://github.com/joelwking","followers_url":"https://api.github.com/users/joelwking/followers","following_url":"https://api.github.com/users/joelwking/following{/other_user}","gists_url":"https://api.github.com/users/joelwking/gists{/gist_id}","starred_url":"https://api.github.com/users/joelwking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelwking/subscriptions","organizations_url":"https://api.github.com/users/joelwking/orgs","repos_url":"https://api.github.com/users/joelwking/repos","events_url":"https://api.github.com/users/joelwking/events{/privacy}","received_events_url":"https://api.github.com/users/joelwking/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-22T15:18:26Z","updated_at":"2016-03-22T15:27:16Z","closed_at":null,"body":"##### Issue Type:\r\n\r\n<!-- Please pick one and delete the rest: -->\r\n - Feature Idea\r\n\r\n##### Plugin Name:\r\n\r\nnxos_command\r\n\r\n##### Ansible Version:\r\n\r\n```\r\nansible 2.0.1.0\r\n```\r\n##### Ansible Configuration:\r\n\r\n<!-- Please mention any settings you've changed/added/removed in ansible.cfg\r\n(or using the ANSIBLE_* environment variables). -->\r\nN/A\r\n##### Environment:\r\n\r\nN/A\r\n##### Summary:\r\n\r\nWrong requests message version for NX-API. Feature request to include the NX-API version as an argument for older switches to override.\r\n```\r\nnxos_command:\r\n  version: \"1.0\"\r\n```\r\n##### Steps To Reproduce:\r\n\r\nRunning NX-OS\r\n```\r\nNEX-3048-A# show version | inc ver\r\nSome parts of this software are covered under the GNU Public\r\n  BIOS:      version 1.2.0\r\n  loader:    version N/A\r\n  kickstart: version 6.0(2)U5(1)\r\n  system:    version 6.0(2)U5(1)\r\n             Module 1: version v4.4\r\n  System version: 6.0(2)U5(1)\r\n\r\n---\r\n#\r\n#      Copyright (c) 2016 World Wide Technology, Inc.\r\n#      All rights reserved.\r\n#\r\n#      author: Joel W. King,  World Wide Technology\r\n#\r\n#      Modified 22 March 2016\r\n#\r\n- name: Demonstrate the new Ansible Network Modules\r\n  hosts: localhost\r\n  connection: local\r\n  gather_facts: no\r\n\r\n  vars:\r\n    cmds:\r\n      - show version\r\n      - show hardware\r\n\r\n  tasks:\r\n  - name: Decrypt the password file\r\n    include_vars: \"./passwords.yml\"\r\n\r\n  - name: Run arbitrary command on Cisco NXOS devices\r\n    nxos_command:\r\n      commands: \"{{item}}\"\r\n      transport: nxapi\r\n      username: admin\r\n      password: \"{{password}}\"\r\n      host: 10.255.40.87\r\n      port:  \"80\"\r\n    with_items: \"{{cmds}}\"\r\n\r\n```\r\n##### Expected Results:\r\nN/A\r\n\r\n##### Actual Results:\r\n\r\n<!-- What actually happened? If possible run with high verbosity (-vvvv) -->\r\n\r\n```\r\nfailed: [localhost] => (item=show version) => {\"failed\": true, \"invocation\": {\"module_args\": {\"commands\": [\"show version\"], \"host\": \"10.255.40.87\", \"interval\": 1, \"password\": \"VALUE_SPECIFIED_IN_NO_LOG_PARAMETER\", \"port\": 80, \"provider\": null, \"retries\": 10, \"transport\": \"nxapi\", \"url_password\": \"VALUE_SPECIFIED_IN_NO_LOG_PARAMETER\", \"url_username\": \"admin\", \"use_ssl\": false, \"username\": \"admin\", \"waitfor\": null}, \"module_name\": \"nxos_command\"}, \"item\": \"show version\", \"msg\": \"**HTTP Error 400: Bad Request\", \"status\": 400, \"url\": \"http://10.255.40.87:80/ins\"}**\r\nfailed: [localhost] => (item=show hardware) => {\"failed\": true, \"invocation\": {\"module_args\": {\"commands\": [\"show hardware\"], \"host\": \"10.255.40.87\", \"interval\": 1, \"password\": \"VALUE_SPECIFIED_IN_NO_LOG_PARAMETER\", \"port\": 80, \"provider\": null, \"retries\": 10, \"transport\": \"nxapi\", \"url_password\": \"VALUE_SPECIFIED_IN_NO_LOG_PARAMETER\", \"url_username\": \"admin\", \"use_ssl\": false, \"username\": \"admin\", \"waitfor\": null}, \"module_name\": \"nxos_command\"}, \"item\": \"show hardware\", \"msg\": \"HTTP Error 400: Bad Request\", \"status\": 400, \"url\": \"http://10.255.40.87:80/ins\"}\r\n\r\n```\r\nThis switch version does not support sending version 1.2, expecting version 1.0\r\n```\r\n10:54:58.467398 IP 10.255.40.27.54474 > 10.255.40.87.http: Flags [P.], seq 1:359, ack 1, win 29200, options [nop,nop,TS val 459406 ecr 298659600], length 358\r\n        0x0000:  4500 019a 0538 4000 4006 cdb6 0aff 281b  E....8@.@.....(.\r\n        0x0010:  0aff 2857 d4ca 0050 d355 07b9 57a6 ed75  ..(W...P.U..W..u\r\n        0x0020:  8018 7210 67fc 0000 0101 080a 0007 028e  ..r.g...........\r\n        0x0030:  11cd 2f10 504f 5354 202f 696e 7320 4854  ../.POST./ins.HT\r\n        0x0040:  5450 2f31 2e31 0d0a 4163 6365 7074 2d45  TP/1.1..Accept-E\r\n        0x0050:  6e63 6f64 696e 673a 2069 6465 6e74 6974  ncoding:.identit\r\n        0x0060:  790d 0a43 6f6e 7465 6e74 2d4c 656e 6774  y..Content-Lengt\r\n        0x0070:  683a 2031 3238 0d0a 436f 6e6e 6563 7469  h:.128..Connecti\r\n        0x0080:  6f6e 3a20 636c 6f73 650d 0a55 7365 722d  on:.close..User-\r\n        0x0090:  4167 656e 743a 204e 6f6e 650d 0a48 6f73  Agent:.None..Hos\r\n        0x00a0:  743a 2031 302e 3235 352e 3430 2e38 373a  t:.10.255.40.87:\r\n        0x00b0:  3830 0d0a 4361 6368 652d 436f 6e74 726f  80..Cache-Contro\r\n        0x00c0:  6c3a 206e 6f2d 6361 6368 650d 0a43 6f6e  l:.no-cache..Con\r\n        0x00d0:  7465 6e74 2d54 7970 653a 2061 7070 6c69  tent-Type:.appli\r\n        0x00e0:  6361 7469 6f6e 2f6a 736f 6e0d 0a41 7574  cation/json..Aut\r\n        0x00f0:  686f 7269 7a61 7469 6f6e 3a20 4261 7369  horization:.Basi\r\n        0x0100:  6320 5957 5274 6157 3436 5631 6455 6433  c.YWRtaW46V1dUd3\r\n        0x0110:  6430 4d53 453d 0d0a 0d0a 7b22 696e 735f  d0MSE=....{\"ins_\r\n        0x0120:  6170 6922 3a20 7b22 6368 756e 6b22 3a20  api\":.{\"chunk\":.\r\n        0x0130:  2230 222c 2022 7665 7273 696f 6e22 3a20  \"0\",.\"version\":.\r\n        0x0140:  2231 2e32 222c 2022 7369 6422 3a20 6e75  \"1.2\",.\"sid\":.nu\r\n        0x0150:  6c6c 2c20 2269 6e70 7574 223a 2022 7368  ll,.\"input\":.\"sh\r\n        0x0160:  6f77 2076 6572 7369 6f6e 222c 2022 7479  ow.version\",.\"ty\r\n        0x0170:  7065 223a 2022 636c 695f 7368 6f77 222c  pe\":.\"cli_show\",\r\n        0x0180:  2022 6f75 7470 7574 5f66 6f72 6d61 7422  .\"output_format\"\r\n        0x0190:  3a20 226a 736f 6e22 7d7d                 :.\"json\"}}\r\n10:54:58.470929 IP 10.255.40.87.http > 10.255.40.27.54473: Flags [F.], seq 392, ack 316, win 17376, options [nop,nop,TS val 298659600 ecr 459406], length 0\r\n        0x0000:  4500 0034 8020 4000 4006 5434 0aff 2857  E..4..@.@.T4..(W\r\n        0x0010:  0aff 281b 0050 d4c9 ffb0 dd7c 2f53 a0f4  ..(..P.....|/S..\r\n        0x0020:  8011 43e0 066b 0000 0101 080a 11cd 2f10  ..C..k......../.\r\n        0x0030:  0007 028e                                ....\r\n10:54:58.492072 IP 10.255.40.87.http > 10.255.40.27.54474: Flags [P.], seq 1:419, ack 359, win 17376, options [nop,nop,TS val 298659601 ecr 459406], length 418\r\n        0x0000:  4500 01d6 8021 4000 4006 5291 0aff 2857  E....!@.@.R...(W\r\n        0x0010:  0aff 281b 0050 d4ca 57a6 ed75 d355 091f  ..(..P..W..u.U..\r\n        0x0020:  8018 43e0 d005 0000 0101 080a 11cd 2f11  ..C.........../.\r\n        0x0030:  0007 028e 4854 5450 2f31 2e31 2034 3030  ....HTTP/1.1.400\r\n        0x0040:  2042 6164 2052 6571 7565 7374 0d0a 5365  .Bad.Request..Se\r\n        0x0050:  7276 6572 3a20 6e67 696e 782f 312e 342e  rver:.nginx/1.4.\r\n        0x0060:  350d 0a44 6174 653a 2054 7565 2c20 3232  5..Date:.Tue,.22\r\n        0x0070:  204d 6172 2032 3031 3620 3134 3a35 343a  .Mar.2016.14:54:\r\n        0x0080:  3538 2047 4d54 0d0a 436f 6e74 656e 742d  58.GMT..Content-\r\n        0x0090:  5479 7065 3a20 7465 7874 2f78 6d6c 0d0a  Type:.text/xml..\r\n        0x00a0:  5472 616e 7366 6572 2d45 6e63 6f64 696e  Transfer-Encodin\r\n        0x00b0:  673a 2063 6875 6e6b 6564 0d0a 436f 6e6e  g:.chunked..Conn\r\n        0x00c0:  6563 7469 6f6e 3a20 636c 6f73 650d 0a53  ection:.close..S\r\n        0x00d0:  6574 2d43 6f6f 6b69 653a 206e 7861 7069  et-Cookie:.nxapi\r\n        0x00e0:  5f61 7574 683d 6164 6d69 6e3a 3134 3538  _auth=admin:1458\r\n        0x00f0:  3635 3930 3931 3737 3138 3837 3339 0d0a  65909177188739..\r\n        0x0100:  0d0a 6339 0d0a 3c3f 786d 6c20 7665 7273  ..c9..<?xml.vers\r\n        0x0110:  696f 6e3d 2231 2e30 223f 3e0a 3c69 6e73  ion=\"1.0\"?>.<ins\r\n        0x0120:  5f61 7069 3e0a 2020 3c6f 7574 7075 7473  _api>...<outputs\r\n        0x0130:  3e0a 2020 2020 3c6f 7574 7075 743e 0a20  >.....<output>..\r\n        0x0140:  2020 2020 203c 6d73 673e 5772 6f6e 6720  .....<msg>Wrong.\r\n        0x0150:  7265 7175 6573 7420 6d65 7373 6167 6520  request.message.\r\n        0x0160:  7665 7273 696f 6e2c 2065 7870 6563 7469  version,.expecti\r\n        0x0170:  6e67 2031 2e30 2e20 5265 7175 6573 7420  ng.1.0..Request.\r\n        0x0180:  6973 2072 656a 6563 7465 642e 3c2f 6d73  is.rejected.</ms\r\n        0x0190:  673e 0a20 2020 2020 203c 636f 6465 3e34  g>.......<code>4\r\n        0x01a0:  3030 3c2f 636f 6465 3e0a 2020 2020 3c2f  00</code>.....</\r\n        0x01b0:  6f75 7470 7574 3e0a 2020 3c2f 6f75 7470  output>...</outp\r\n        0x01c0:  7574 733e 0a3c 2f69 6e73 5f61 7069 3e0d  uts>.</ins_api>.\r\n        0x01d0:  0a30 0d0a 0d0a                           .0....\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/199865015","html_url":"https://github.com/ansible/ansible-modules-core/issues/3304#issuecomment-199865015","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3304","id":199865015,"user":{"login":"joelwking","id":8416404,"avatar_url":"https://avatars.githubusercontent.com/u/8416404?v=3","gravatar_id":"","url":"https://api.github.com/users/joelwking","html_url":"https://github.com/joelwking","followers_url":"https://api.github.com/users/joelwking/followers","following_url":"https://api.github.com/users/joelwking/following{/other_user}","gists_url":"https://api.github.com/users/joelwking/gists{/gist_id}","starred_url":"https://api.github.com/users/joelwking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelwking/subscriptions","organizations_url":"https://api.github.com/users/joelwking/orgs","repos_url":"https://api.github.com/users/joelwking/repos","events_url":"https://api.github.com/users/joelwking/events{/privacy}","received_events_url":"https://api.github.com/users/joelwking/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T15:27:16Z","updated_at":"2016-03-22T15:27:16Z","body":"version is a string."}}