'utf8' codec can't decode byte 0xff in position 0: invalid start byte"

43 views
Skip to first unread message

Suporter

unread,
Apr 24, 2017, 4:24:01 AM4/24/17
to Ansible Project
Getting the subject mentioned error while reading a compressed json, any workaround for this?
    - name: read local file
      set_fact
:
       reg_changes
: "{{ lookup('file', '/home/tess/xl.json') | from_json }}"                    
      delegate_to
: localhost

J Hawkesworth

unread,
Apr 24, 2017, 7:36:17 AM4/24/17
to Ansible Project
Try using a site like jsonlint.com to check if your xl.json is actually valid JSON.

Toshio Kuratomi

unread,
Apr 24, 2017, 11:44:11 AM4/24/17
to ansible...@googlegroups.com
If it's compressed, you probably need to uncompress it first.  The from_json filter doesn't have builtin support for decompressing files.  (I don't believe any of our filters do)

-Toshio

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7875c956-b905-4e9a-9ed3-5684b5025412%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages