{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/4213","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/4213/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/4213/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/4213/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/4213","id":166401939,"number":4213,"title":"decode error when using nxos_template module","user":{"login":"mattlan","id":6219884,"avatar_url":"https://avatars.githubusercontent.com/u/6219884?v=3","gravatar_id":"","url":"https://api.github.com/users/mattlan","html_url":"https://github.com/mattlan","followers_url":"https://api.github.com/users/mattlan/followers","following_url":"https://api.github.com/users/mattlan/following{/other_user}","gists_url":"https://api.github.com/users/mattlan/gists{/gist_id}","starred_url":"https://api.github.com/users/mattlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattlan/subscriptions","organizations_url":"https://api.github.com/users/mattlan/orgs","repos_url":"https://api.github.com/users/mattlan/repos","events_url":"https://api.github.com/users/mattlan/events{/privacy}","received_events_url":"https://api.github.com/users/mattlan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-19T18:29:04Z","updated_at":"2016-07-19T18:29:04Z","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##### COMPONENT NAME\r\n<!--- Name of the plugin/module/task -->\r\nnxos_template\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```\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\n[defaults]\r\ntransport = local\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\nMac OS X 10.11.5 (Ansible host)\r\nNX-OS 7.0(3)I2(2d) (Remote host)\r\n\r\n##### SUMMARY\r\n<!--- Explain the problem briefly -->\r\nTrying to push a pre-assembled config using nxos_template module in playbook, get the below error.\r\n\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\nRun the below playbook reproduces the issue every time on my workstation.\r\n\r\n\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```\r\n---\r\n- name: nxos template\r\n  hosts: n9k\r\n  connection: local\r\n  gather_facts: no\r\n  tasks:\r\n    - name: apply template\r\n      nxos_template:\r\n        host: n9k\r\n        transport: nxapi\r\n        port: 80\r\n        username: \"{{ login_user }}\"\r\n        password: \"{{ login_passwd }}\"\r\n        src: /path/to/assembled.conf\r\n        config: /path/to/backup.conf\r\n```\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\nExpected config to apply to device.\r\n\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->\r\nGot below error during task execution.\r\n<!--- Paste verbatim command output between quotes below -->\r\n```\r\nAn exception occurred during task execution. The full traceback is:\r\nTraceback (most recent call last):\r\n  File \"/var/folders/px/2swzrzf51rj2bh5y7j4mf6f8vmb7lz/T/ansible_iOPreV/ansible_module_nxos_template.py\", line 164, in <module>\r\n    main()\r\n  File \"/var/folders/px/2swzrzf51rj2bh5y7j4mf6f8vmb7lz/T/ansible_iOPreV/ansible_module_nxos_template.py\", line 151, in main\r\n    response = module.configure(commands)\r\n  File \"/var/folders/px/2swzrzf51rj2bh5y7j4mf6f8vmb7lz/T/ansible_iOPreV/ansible_modlib.zip/ansible/module_utils/nxos.py\", line 235, in configure\r\n  File \"/var/folders/px/2swzrzf51rj2bh5y7j4mf6f8vmb7lz/T/ansible_iOPreV/ansible_modlib.zip/ansible/module_utils/nxos.py\", line 247, in execute\r\n  File \"/var/folders/px/2swzrzf51rj2bh5y7j4mf6f8vmb7lz/T/ansible_iOPreV/ansible_modlib.zip/ansible/module_utils/nxos.py\", line 146, in send\r\n  File \"/var/folders/px/2swzrzf51rj2bh5y7j4mf6f8vmb7lz/T/ansible_iOPreV/ansible_modlib.zip/ansible/module_utils/basic.py\", line 1712, in from_json\r\n  File \"/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py\", line 339, in loads\r\n    return _default_decoder.decode(s)\r\n  File \"/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py\", line 364, in decode\r\n    obj, end = self.raw_decode(s, idx=_w(s, 0).end())\r\n  File \"/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py\", line 380, in raw_decode\r\n    obj, end = self.scan_once(s, idx)\r\nUnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0: invalid start byte\r\n```"}}
{"actor":{"display_login":"mattlan"}}