<?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: [Ansible] Unable to obtain sid in Ansible</title>
    <link>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31933#M45</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A href="https://community.checkpoint.com/migrated-users/2075"&gt;Dameon Welch-Abernathy&lt;/A&gt;‌ and other folks,&lt;/P&gt;&lt;P&gt;I need your help to fix 1 issue .&lt;BR /&gt;While executing your given script in my test environment i am getting below error:&lt;BR /&gt;TASK [Add CheckMatesDemo group] ****************************************************************************************************************************************&lt;BR /&gt;fatal: [localhost]: FAILED! =&amp;gt; {"changed": false, "msg": "Command 'add-group {u'name': u'CheckMatesDemo'}' &lt;BR /&gt;failed with error message: Missing header: [X-chkp-sid]. All changes are discarded and the session is invalidated."}&lt;BR /&gt;to retry, use: --limit @/etc/ansible/cp2.retry&lt;/P&gt;&lt;P&gt;I am trying to execute CheckMates_AddHost.yml&lt;/P&gt;&lt;P&gt;FYI: API is enable on the MGMT server for all IP addresses but don't know why SID is coming as null.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Dec 2018 02:39:52 GMT</pubDate>
    <dc:creator>Tribhawan_Singh</dc:creator>
    <dc:date>2018-12-11T02:39:52Z</dc:date>
    <item>
      <title>[Ansible] Unable to obtain sid</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31928#M40</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to write a simple ansible play, containing only a login and a logout task, by following the instructions found here: &lt;A class="jivelink1" href="https://github.com/CheckPointSW/cpAnsible" title="https://github.com/CheckPointSW/cpAnsible"&gt;https://github.com/CheckPointSW/cpAnsible&lt;/A&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;My playbook looks like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;---&lt;BR /&gt;- hosts: "firewalls"&lt;BR /&gt;&amp;nbsp; tasks:&lt;BR /&gt;&amp;nbsp; - name: "login"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; check_point_mgmt:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; command: login&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parameters:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; username: "{{mgmt_user}}"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; password: "{{mgmt_password}}"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; management: "{{mgmt_server}}"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fingerprint: "{{mgmt_fingerprint}}"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; register: login_response&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; - name: "logout"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; check_point_mgmt:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; command: logout&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; session-data: "{{login_response}}"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;The login goes ok, but the logout task fails with the following error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;fatal: [127.0.0.1]: FAILED! =&amp;gt; {"changed": false, "msg": "Command 'logout None' failed with error message: Missing header: [X-chkp-sid]. All changes are discarded and the session is invalidated."}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #000000;"&gt;It appears I am unable to obtain a session-id, but I have no idea of how to resolve this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2018 12:59:25 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31928#M40</guid>
      <dc:creator>Simon_Andersso1</dc:creator>
      <dc:date>2018-06-18T12:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: [Ansible] Unable to obtain sid</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31929#M41</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have any indication that login command was successful?&lt;/P&gt;&lt;P&gt;session-data holds the session-id inside.&lt;/P&gt;&lt;P&gt;robert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2018 13:14:08 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31929#M41</guid>
      <dc:creator>Robert_Decker</dc:creator>
      <dc:date>2018-06-18T13:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: [Ansible] Unable to obtain sid</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31930#M42</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To be honest, I'm not sure. When running the playbook with the --verbose flag the login task shows ok but sid shows "null".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my full output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLAY [firewalls] ********************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TASK [Gathering Facts] **************************************************************&lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;ok: [127.0.0.1]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TASK [login] ************************************************************************&lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;ok: [127.0.0.1] =&amp;gt; {"changed": false, "response": {"domain": null, "fingerprint": "002451E2D9743CDACC8F7178761FAE4C017AB039", "sid": null, "url": "10.99.81.101:443"}}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TASK [logout] ***********************************************************************&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;fatal: [127.0.0.1]: FAILED! =&amp;gt; {"changed": false, "msg": "Command 'logout None' failed with error message: Missing header: [X-chkp-sid]. All changes are discarded and the session is invalidated."}&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; to retry, use: --limit @/home/simand/ansible_platform/cp_test.retry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLAY RECAP **************************************************************************&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;127.0.0.1&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #008000;"&gt;: ok=2&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; changed=0&amp;nbsp;&amp;nbsp;&amp;nbsp; unreachable=0&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;failed=1&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2018 13:31:16 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31930#M42</guid>
      <dc:creator>Simon_Andersso1</dc:creator>
      <dc:date>2018-06-18T13:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: [Ansible] Unable to obtain sid</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31931#M43</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;have you configured your management API server to accept connections from remote machines?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2018 13:41:15 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31931#M43</guid>
      <dc:creator>Robert_Decker</dc:creator>
      <dc:date>2018-06-18T13:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: [Ansible] Unable to obtain sid</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31932#M44</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I feel so stupid now. I had completely missed that step in the tutorial. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2018 13:47:12 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31932#M44</guid>
      <dc:creator>Simon_Andersso1</dc:creator>
      <dc:date>2018-06-18T13:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: [Ansible] Unable to obtain sid</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31933#M45</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A href="https://community.checkpoint.com/migrated-users/2075"&gt;Dameon Welch-Abernathy&lt;/A&gt;‌ and other folks,&lt;/P&gt;&lt;P&gt;I need your help to fix 1 issue .&lt;BR /&gt;While executing your given script in my test environment i am getting below error:&lt;BR /&gt;TASK [Add CheckMatesDemo group] ****************************************************************************************************************************************&lt;BR /&gt;fatal: [localhost]: FAILED! =&amp;gt; {"changed": false, "msg": "Command 'add-group {u'name': u'CheckMatesDemo'}' &lt;BR /&gt;failed with error message: Missing header: [X-chkp-sid]. All changes are discarded and the session is invalidated."}&lt;BR /&gt;to retry, use: --limit @/etc/ansible/cp2.retry&lt;/P&gt;&lt;P&gt;I am trying to execute CheckMates_AddHost.yml&lt;/P&gt;&lt;P&gt;FYI: API is enable on the MGMT server for all IP addresses but don't know why SID is coming as null.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2018 02:39:52 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31933#M45</guid>
      <dc:creator>Tribhawan_Singh</dc:creator>
      <dc:date>2018-12-11T02:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: [Ansible] Unable to obtain sid</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31934#M46</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which "given script" are you discussing?&lt;/P&gt;&lt;P&gt;I recommend posting the question on the relevant thread where the script was shared with more details about how exactly you are invoking it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;In general&lt;/STRONG&gt;&lt;/EM&gt;, you have to "login" to the API, which will generate a session ID.&lt;/P&gt;&lt;P&gt;That session ID would be passed via a X-chkp-sid on subsequent calls to the API.&lt;/P&gt;&lt;P&gt;My guess is in the ansible playbook you called, you forgot the login action.&lt;/P&gt;&lt;P&gt;But, like I said, I recommend continuing the discussion on the relevant thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2018 05:17:36 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31934#M46</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2018-12-11T05:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: [Ansible] Unable to obtain sid</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31935#M47</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply &lt;A href="https://community.checkpoint.com/migrated-users/2075"&gt;Dameon Welch-Abernathy&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;There was some permission issue. post correction that everything worked as expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2018 12:37:24 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/31935#M47</guid>
      <dc:creator>Tribhawan_Singh</dc:creator>
      <dc:date>2018-12-11T12:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: [Ansible] Unable to obtain sid</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/52200#M48</link>
      <description>&lt;P&gt;Hello, I'm getting the same error message and I've tried many things but doesn't work. Do you mind elaborating what you did to resolve your issues? Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 00:59:06 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-Unable-to-obtain-sid/m-p/52200#M48</guid>
      <dc:creator>James_Le</dc:creator>
      <dc:date>2019-04-30T00:59:06Z</dc:date>
    </item>
  </channel>
</rss>

