<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: no JSON object could be decoded - &amp;quot;MODULE FAILURE&amp;quot; in Ansible</title>
    <link>https://community.checkpoint.com/t5/Ansible/no-JSON-object-could-be-decoded-quot-MODULE-FAILURE-quot/m-p/8546#M248</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you see anything in the api status -s output that might give a clue?&lt;/P&gt;&lt;P&gt;This creates a tarball of various log files--the api.elg file is probably the most interesting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Mar 2019 01:41:14 GMT</pubDate>
    <dc:creator>PhoneBoy</dc:creator>
    <dc:date>2019-03-01T01:41:14Z</dc:date>
    <item>
      <title>no JSON object could be decoded - "MODULE FAILURE"</title>
      <link>https://community.checkpoint.com/t5/Ansible/no-JSON-object-could-be-decoded-quot-MODULE-FAILURE-quot/m-p/8545#M247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Trying to create VPN via play book results in the error as below.&lt;/P&gt;&lt;P&gt;I also noticed that the api doesnot have all the commands for example, you cannot create vpn interoperable device via api so I had to manually create interoperable device to test out the VPN creation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the VPN entry in .yml&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/79698_pastedImage_4.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;[root@Ansible-Cent Playbooks]# ansible-playbook -C vpn-testing.yml&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;PLAY [localhost]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;.....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;TASK [create VPN community] *************************************************************************************************************************************************************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt;fatal: [127.0.0.1]: FAILED! =&amp;gt; {"changed": false, "module_stderr": "Shared connection to 127.0.0.1 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/tmp/ansible_tvlW8Y/ansible_module_check_point_mgmt.py\", line 256, in &amp;lt;module&amp;gt;\r\n main()\r\n File \"/tmp/ansible_tvlW8Y/ansible_module_check_point_mgmt.py\", line 136, in main\r\n parameters = json.loads(parameters)\r\n File \"/usr/local/lib/python2.7/json/__init__.py\", line 339, in loads\r\n return _default_decoder.decode(s)\r\n File \"/usr/local/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/lib/python2.7/json/decoder.py\", line 382, in raw_decode\r\n raise ValueError(\"No JSON object could be decoded\")\r\nValueError: No JSON object could be decoded\r\n", "msg": "MODULE FAILURE", "rc": 1}&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN style="font-size: 12px;"&gt;to retry, use: --limit @/root/cpAnsible/Playbooks/yunus-demo3.retry&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;PLAY RECAP ******************************************************************************************************************************************************************************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12px; "&gt;127.0.0.1 : ok=7 changed=0 unreachable=0 failed=1&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2019 00:57:15 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/no-JSON-object-could-be-decoded-quot-MODULE-FAILURE-quot/m-p/8545#M247</guid>
      <dc:creator>Yunus_Badar</dc:creator>
      <dc:date>2019-03-01T00:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: no JSON object could be decoded - "MODULE FAILURE"</title>
      <link>https://community.checkpoint.com/t5/Ansible/no-JSON-object-could-be-decoded-quot-MODULE-FAILURE-quot/m-p/8546#M248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you see anything in the api status -s output that might give a clue?&lt;/P&gt;&lt;P&gt;This creates a tarball of various log files--the api.elg file is probably the most interesting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2019 01:41:14 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/no-JSON-object-could-be-decoded-quot-MODULE-FAILURE-quot/m-p/8546#M248</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-03-01T01:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: no JSON object could be decoded - "MODULE FAILURE"</title>
      <link>https://community.checkpoint.com/t5/Ansible/no-JSON-object-could-be-decoded-quot-MODULE-FAILURE-quot/m-p/8547#M249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In api.elg, after id 78, I was expecting id 79 to be "add-vpn-community-star". but that was not the case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;id 78:&lt;/P&gt;&lt;P&gt;Address: http://127.0.0.1:50276/web_api/add-access-rule&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;which made me go line by line for yml configuration and I found out through error and trial that following line was causing the error to be thrown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"use-shared-secret: true"&lt;/P&gt;&lt;P&gt;The "use-shared-secret: true" doesnot work at all and throws error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;once removed, the error didn't occur and VPN section&lt;/P&gt;&lt;P&gt;- name: create VPN community&lt;BR /&gt; check_point_mgmt:&lt;BR /&gt; command: add-vpn-community-star&lt;BR /&gt; parameters:&lt;BR /&gt; name: "Ottawa VPN"&lt;BR /&gt; center-gateways: cp-fw1&lt;BR /&gt; satellite-gateways: ottawa-vpn-gw&lt;BR /&gt; encryption-method: ikev2 only&lt;BR /&gt; encryption-suite: suite-b-gcm-256&lt;BR /&gt; shared-secrets:&lt;BR /&gt; - external-gateway: ottawa-vpn-gw&lt;BR /&gt; shared-secret: mysharedsecret120length&lt;BR /&gt; session-data: '{{login_response}}'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;question:&lt;/P&gt;&lt;P&gt;1) I know in gui you have to use " use shared secret for all external vpn" for it to allow adding PSK for remote gateway. Why it fails when using in yml? looks like some sort of api bug. This feature is needed to enable PSK otherwise PSK will be setup manually like interoperable device which defeats the purpose of automation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Why the api for VPN is missing important things like "interoperable device". This is absolutely needed for VPN automation along with other params like cutom encryption. Any Plans to have this available in near future?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2019 13:01:23 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/no-JSON-object-could-be-decoded-quot-MODULE-FAILURE-quot/m-p/8547#M249</guid>
      <dc:creator>Yunus_Badar</dc:creator>
      <dc:date>2019-03-01T13:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: no JSON object could be decoded - "MODULE FAILURE"</title>
      <link>https://community.checkpoint.com/t5/Ansible/no-JSON-object-could-be-decoded-quot-MODULE-FAILURE-quot/m-p/8548#M250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The question is whether it's the Ansible module or the API that's the source of the error.&lt;/P&gt;&lt;P&gt;It's not clear from the error which.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can't really comment on why the API is missing calls for interoperable devices, but it's a known limitation.&lt;/P&gt;&lt;P&gt;In some cases, you may be able to achieve automation through the generic-object API, though obviously less ideal than official API support.&lt;/P&gt;&lt;P&gt;There are some threads on this on CheckMates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There doesn't appear to be anything in the upcoming R80.30 for this (planned for the next several weeks).&lt;/P&gt;&lt;P&gt;In addition to letting us know here (which you did), you should also discuss these requirements with your local office.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Mar 2019 00:55:03 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/no-JSON-object-could-be-decoded-quot-MODULE-FAILURE-quot/m-p/8548#M250</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-03-02T00:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: no JSON object could be decoded - "MODULE FAILURE"</title>
      <link>https://community.checkpoint.com/t5/Ansible/no-JSON-object-could-be-decoded-quot-MODULE-FAILURE-quot/m-p/8549#M251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The source of the error is actually the conversion of the code of parameters into JSON. The boolean in Ansible should be defined as yes|no and Ansible will convert that into true boolean as true|false. To give also some clarity, here are some additional explanations and how to use true booleans in Ansible:&amp;nbsp;&lt;A class="unlinked"&gt;hxxps://emilwypych.com/2018/01/28/ansible-boolean-variable-in-extra-vars/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So far I can see the problem at the JSONDecoder (import json) for Python 2.7&lt;/P&gt;&lt;P&gt;Will update once I have more ...&lt;/P&gt;&lt;P&gt;UPDATE:&lt;/P&gt;&lt;P&gt;The problem as suspected, the produced boolean values by Ansible are capitalized on the first letter. JSON format takes only in lower case, so just do a replace on the parameters and that solves the issue.&lt;/P&gt;&lt;P&gt;Ansible module: check_point_mgmt.py&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;After line134: parameters &lt;/SPAN&gt;&lt;SPAN class="" style="color: #d73a49; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt; parameters.replace(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #032f62; background-color: #ffffff;"&gt;&lt;SPAN class="" style="color: #032f62;"&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;\\\\\"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #032f62;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;, &lt;/SPAN&gt;&lt;SPAN class="" style="color: #032f62; background-color: #ffffff;"&gt;&lt;SPAN class="" style="color: #032f62;"&gt;"&lt;/SPAN&gt;'&lt;SPAN class="" style="color: #032f62;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;Add two lines:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;SPAN&gt;parameters &lt;/SPAN&gt;&lt;SPAN class="" style="color: #d73a49;"&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; parameters.replace(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #032f62;"&gt;&lt;SPAN class="" style="color: #032f62;"&gt;"True"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class="" style="color: #032f62;"&gt;&lt;SPAN class="" style="color: #032f62;"&gt;"true&lt;/SPAN&gt;&lt;SPAN class="" style="color: #032f62;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;parameters &lt;/SPAN&gt;&lt;SPAN class="" style="color: #d73a49; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt; parameters.replace(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #032f62; background-color: #ffffff;"&gt;&lt;SPAN class="" style="color: #032f62;"&gt;"False"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;, "&lt;/SPAN&gt;&lt;SPAN class="" style="color: #032f62; background-color: #ffffff;"&gt;&lt;SPAN class="" style="color: #032f62;"&gt;false"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; "&gt;Additionally, the parameters in the API commands that are of Object type, only need indentation on the new line. Parameters with List type, need a dash on the new indented line.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; "&gt;Also, it seems like the Management API take all lowercase boolean values.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; "&gt;Hopefully, that helps somebody. I also submitted an issue for that Ansible module on github.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2019 00:47:33 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/no-JSON-object-could-be-decoded-quot-MODULE-FAILURE-quot/m-p/8549#M251</guid>
      <dc:creator>Artur_Zalenekas</dc:creator>
      <dc:date>2019-03-06T00:47:33Z</dc:date>
    </item>
  </channel>
</rss>

