<?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 2.9: using the new Check Point modules, getting invalid/incorrect password in Ansible</title>
    <link>https://community.checkpoint.com/t5/Ansible/Ansible-2-9-using-the-new-Check-Point-modules-getting-invalid/m-p/67330#M211</link>
    <description>&lt;P&gt;Not sure if it's by design or a bug, but&amp;nbsp;&lt;STRONG&gt;ansible_connection&amp;nbsp;&lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;ansible_python_interpreter&amp;nbsp;&lt;/STRONG&gt;seemed to be the culprit in my host file. Uncommenting them both seemed to fix the issue. Unfortunately for me, my other tasks rely on these variables, so uncommenting them isn't a solution. Defining them as var inside the play, which override the host file vars, seemed to do the trick.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;---
- name: test
  hosts: management
  connection: httpapi
  vars:
    ansible_connection: httpapi
    ansible_python_interpreter:
    ansible_user: demis
    ansible_password: configsystem123

  tasks:

  - name: Create host object
    checkpoint_host:
      name: workaround3
      ip_address: 192.168.0.193&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2019 20:44:57 GMT</pubDate>
    <dc:creator>DemisT</dc:creator>
    <dc:date>2019-11-13T20:44:57Z</dc:date>
    <item>
      <title>Ansible 2.9: using the new Check Point modules, getting invalid/incorrect password</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-2-9-using-the-new-Check-Point-modules-getting-invalid/m-p/67267#M209</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;With the new Check Point modules released in Ansible 2.9, I'm trying to run a simple Ansible playbook. Unfortunately when running the playbook, I'm getting an error that says:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fatal: [SMS]: UNREACHABLE! =&amp;gt; {"changed": false, "msg": "Invalid/incorrect password: This system is for authorized use only.\nPermission denied, please try again.", "unreachable": true}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have enabled the API from SmartConsole dashboard under Manage &amp;amp; Settings &amp;gt; Blades &amp;gt; Management API &amp;gt; All IP addresses and performed an API restart.&lt;/P&gt;&lt;P&gt;I've also installed the relevant hotfix &lt;STRONG&gt;(Check_Point_R80.30_JHF_T76_Ansible_Hotfix_sk114661_FULL.tgz)&amp;nbsp;&lt;/STRONG&gt;and verified with&amp;nbsp;&lt;STRONG&gt;show installer packages installed&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;The playbook looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;---
- name: test
  hosts: management
  connection: httpapi
  gather_facts: no

  tasks:

    - name: show-networks
      cp_mgmt_network_facts:
        details_level: standard
      register: response&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My host file looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[management:vars]
ansible_connection=ssh
ansible_user=&amp;lt;Smartconsole user&amp;gt;
ansible_password=&amp;lt;SmartConsole password&amp;gt;
ansible_python_interpreter="/opt/CPsuite-R8*/fw1/Python/bin/python"
ansible_httpapi_validate_certs=False
ansible_httpapi_use_ssl=True
ansible_network_os=checkpoint&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've verified logging into Smart Console manually with these credentials, which is working. Also a curl command from the ansible host seems to be working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -vvvv -H "Content-Type: application/json" -X POST -d '{"user":"demis","password":"adminsystempass123"}' &amp;lt;a href="&amp;lt;a href="https://10.23.112.110/web_api/login" target="_blank"&amp;gt;https://10.23.112.110/web_api/login&amp;lt;/a&amp;gt;" target="_blank"&amp;gt;&amp;lt;a href="https://10.23.112.110/web_api/login&amp;lt;/a" target="_blank"&amp;gt;https://10.23.112.110/web_api/login&amp;lt;/a&amp;lt;/a&amp;gt;&amp;gt; --insecure&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: I was using the SmartConsole username/password which is probably why the error occurred, but changing it to the Gaia OS username/password gives me this error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AssertionError: socket_path must be a value
fatal: [SMS]: FAILED! =&amp;gt; {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"&amp;lt;stdin&amp;gt;\", line 102, in &amp;lt;module&amp;gt;\n  File \"&amp;lt;stdin&amp;gt;\", line 94, in _ansiballz_main\n  File \"&amp;lt;stdin&amp;gt;\", line 40, in invoke_module\n  File \"/opt/CPsuite-R80.30/fw1/Python/lib/python2.7/runpy.py\", line 192, in run_module\n    fname, loader, pkg_name)\n  File \"/opt/CPsuite-R80.30/fw1/Python/lib/python2.7/runpy.py\", line 72, in _run_code\n    exec code in run_globals\n  File \"/tmp/ansible_cp_mgmt_network_facts_payload_FzOYM2/ansible_cp_mgmt_network_facts_payload.zip/ansible/modules/cp_mgmt_network_facts.py\", line 131, in &amp;lt;module&amp;gt;\n  File \"/tmp/ansible_cp_mgmt_network_facts_payload_FzOYM2/ansible_cp_mgmt_network_facts_payload.zip/ansible/modules/cp_mgmt_network_facts.py\", line 126, in main\n  File \"/tmp/ansible_cp_mgmt_network_facts_payload_FzOYM2/ansible_cp_mgmt_network_facts_payload.zip/ansible_collections/check_point/mgmt/plugins/module_utils/checkpoint.py\", line 170, in api_call_facts\n  File \"/tmp/ansible_cp_mgmt_network_facts_payload_FzOYM2/ansible_cp_mgmt_network_facts_payload.zip/ansible/module_utils/connection.py\", line 121, in __init__\nAssertionError: socket_path must be a value\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 13 Nov 2019 12:22:18 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-2-9-using-the-new-Check-Point-modules-getting-invalid/m-p/67267#M209</guid>
      <dc:creator>DemisT</dc:creator>
      <dc:date>2019-11-13T12:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible 2.9: using the new Check Point modules, getting invalid/incorrect password</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-2-9-using-the-new-Check-Point-modules-getting-invalid/m-p/67319#M210</link>
      <description>Looks like you're calling a Gaia API command and not a Management API command.&lt;BR /&gt;The authentication for those APIs is different (Gaia OS user versus SmartConsole user).</description>
      <pubDate>Wed, 13 Nov 2019 18:04:37 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-2-9-using-the-new-Check-Point-modules-getting-invalid/m-p/67319#M210</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-11-13T18:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible 2.9: using the new Check Point modules, getting invalid/incorrect password</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-2-9-using-the-new-Check-Point-modules-getting-invalid/m-p/67330#M211</link>
      <description>&lt;P&gt;Not sure if it's by design or a bug, but&amp;nbsp;&lt;STRONG&gt;ansible_connection&amp;nbsp;&lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;ansible_python_interpreter&amp;nbsp;&lt;/STRONG&gt;seemed to be the culprit in my host file. Uncommenting them both seemed to fix the issue. Unfortunately for me, my other tasks rely on these variables, so uncommenting them isn't a solution. Defining them as var inside the play, which override the host file vars, seemed to do the trick.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;---
- name: test
  hosts: management
  connection: httpapi
  vars:
    ansible_connection: httpapi
    ansible_python_interpreter:
    ansible_user: demis
    ansible_password: configsystem123

  tasks:

  - name: Create host object
    checkpoint_host:
      name: workaround3
      ip_address: 192.168.0.193&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 20:44:57 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-2-9-using-the-new-Check-Point-modules-getting-invalid/m-p/67330#M211</guid>
      <dc:creator>DemisT</dc:creator>
      <dc:date>2019-11-13T20:44:57Z</dc:date>
    </item>
  </channel>
</rss>

