<?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: Issue creating a host with Ansible in Ansible</title>
    <link>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101249#M391</link>
    <description>Hello, Yes i did follow the configuration guide and no, this too doesn't work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; Please help me</description>
    <pubDate>Thu, 05 Nov 2020 19:44:04 GMT</pubDate>
    <dc:creator>mervin16</dc:creator>
    <dc:date>2020-11-05T19:44:04Z</dc:date>
    <item>
      <title>Issue creating a host with Ansible</title>
      <link>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/100715#M388</link>
      <description>&lt;P&gt;I am trying to create a host on my SMS using Ansible but i am encountering some issues.&lt;/P&gt;&lt;P&gt;Below are some information that might be helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Playbook:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;---
- name: Checkpoint Hosts Management
  hosts: firewalls_checkpoint
  tasks:
    - name: Add a new Host
      check_point.mgmt.cp_mgmt_host:
        ip_address: 192.0.2.1
        name: New Host 1
        state: present
        auto_publish_session: yes&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Inventory&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#This is a group of remote servers for Checkpoint SMS
[firewalls_checkpoint]
ckp_sms

#These are global variables for the group firewalls
[firewalls_checkpoint:vars]
ansible_httpapi_use_ssl=True
ansible_httpapi_validate_certs=False
ansible_user=admin
ansible_password=*****
ansible_ssh_pass=*****
ansible_network_os=check_point.mgmt.checkpoint
ansible_ssh_transfer_method=scp&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ansible.cfg&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[defaults]
host_key_checking = False

[ssh_connection]
scp_if_ssh=True
timeout = 100&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when i run my playbook with command&amp;nbsp;&lt;STRONG&gt;ansible-playbook /etc/ansible/playbooks/checkpoint/network_create.yml&lt;/STRONG&gt;, i get the following error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fatal: [ckp_sms]: FAILED! =&amp;gt; {
    "msg": "failed to transfer file to /root/.ansible/tmp/ansible-local-71858l7zedua/tmpj8i_7uay CLINFR0711  Command insecure/AnsiballZ_setup.py:\n\nCLINFR0329  Invalid command:'scp -t 'CLINFR0711  Command insecure/AnsiballZ_setup.py''.\n"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i ssh directly on a terminal to the SMS, it works fine.&lt;/P&gt;&lt;P&gt;I get the same error message when i try to ping the sms using ansible -m ping&lt;/P&gt;&lt;P&gt;Can someone please help me out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Oct 2020 15:00:52 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/100715#M388</guid>
      <dc:creator>mervin16</dc:creator>
      <dc:date>2020-10-31T15:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Issue creating a host with Ansible</title>
      <link>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/100753#M389</link>
      <description>Can someone please help out ?</description>
      <pubDate>Sun, 01 Nov 2020 06:05:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/100753#M389</guid>
      <dc:creator>mervin16</dc:creator>
      <dc:date>2020-11-01T06:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: Issue creating a host with Ansible</title>
      <link>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/100768#M390</link>
      <description>&lt;P&gt;Did you follow this &lt;A href="https://galaxy.ansible.com/check_point/mgmt" target="_self"&gt;configuration guide ?&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Maybe try&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;- name: add-host
  cp_mgmt_host:
    ip_address: 192.0.2.1
    name: New Host 1
    state: present&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 01 Nov 2020 07:52:54 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/100768#M390</guid>
      <dc:creator>funkylicious</dc:creator>
      <dc:date>2020-11-01T07:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Issue creating a host with Ansible</title>
      <link>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101249#M391</link>
      <description>Hello, Yes i did follow the configuration guide and no, this too doesn't work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; Please help me</description>
      <pubDate>Thu, 05 Nov 2020 19:44:04 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101249#M391</guid>
      <dc:creator>mervin16</dc:creator>
      <dc:date>2020-11-05T19:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Issue creating a host with Ansible</title>
      <link>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101322#M392</link>
      <description>&lt;P&gt;&lt;SPAN style="font-family: inherit; background-color: #f8f8fa;"&gt;Hi,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit; background-color: #ffffff;"&gt;Under the hosts section you are missing the connection parameter&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="pl-ent" style="font-family: inherit; background-color: #ffffff;"&gt;connection&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit; background-color: #ffffff;"&gt;: &lt;/SPAN&gt;&lt;SPAN class="pl-s" style="font-family: inherit; background-color: #ffffff;"&gt;httpapi&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Also, did you download the latest collection from galaxy?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://galaxy.ansible.com/check_point/mgmt" target="_blank"&gt;https://galaxy.ansible.com/check_point/mgmt&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You can find a working example here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/jimoq/demo" target="_blank"&gt;https://github.com/jimoq/demo&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2020 16:21:41 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101322#M392</guid>
      <dc:creator>Jim_Oqvist</dc:creator>
      <dc:date>2020-11-06T16:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Issue creating a host with Ansible</title>
      <link>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101342#M393</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I did what you said and encountered this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;rpc__\nansible.module_utils.connection.ConnectionError: Invalid JSON response: &amp;lt;!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\"&amp;gt;\n&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;\n&amp;lt;title&amp;gt;400 Bad Request&amp;lt;/title&amp;gt;\n&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;\n&amp;lt;h1&amp;gt;Bad Request&amp;lt;/h1&amp;gt;\n&amp;lt;p&amp;gt;Your browser sent a request that this server could not understand.&amp;lt;br /&amp;gt;\n&amp;lt;/p&amp;gt;\n&amp;lt;p&amp;gt;Additionally, a 400 Bad Request\nerror was encountered while trying to use an ErrorDocument to handle the request.&amp;lt;/p&amp;gt;\n&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;\n\n"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We usually get this error when we try to send a request without login to SMS but from Ansible documentation, it specifies that the login and logout is done automatically. So i don't know what's going wrong here. If i run the same command in Check Mode (ansible-playbook -C playbook.yml) it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My updated playbook is :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;---
- name: playbook name
  hosts: firewalls_checkpoint
  connection: httpapi
  tasks:
    - name: task to have network
      check_point.mgmt.cp_mgmt_network:
        name: "network name"
        subnet: "4.1.76.0"
        mask_length: 24
        auto_publish_session: true

      vars:
        ansible_checkpoint_domain: "SMC User"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2020 21:18:27 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101342#M393</guid>
      <dc:creator>mervin16</dc:creator>
      <dc:date>2020-11-06T21:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Issue creating a host with Ansible</title>
      <link>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101382#M397</link>
      <description>&lt;P&gt;Hi Mervin,&lt;/P&gt;
&lt;P&gt;Your playbook is correct. &lt;BR /&gt;Please just not that the variable 'ansible_checkpoint_domain: "SMC User"' is not required when connecting to a SMS &lt;BR /&gt;&lt;BR /&gt;Your /etc/ansible/hosts is not entirely correct. &lt;BR /&gt;I noticed that you have not assigned any ansible_host ip address to ckp_sms, Is chk_sms host name resolving to the IP of your Check Point management server?&lt;BR /&gt;If not you need to set the IP for this host.&lt;BR /&gt;Here is a correct /etc/ansible/hosts section where I removed some lines from the one you posted and added ansible_host ip address.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#This is a group of remote servers for Checkpoint SMS
[firewalls_checkpoint]
ckp_sms ansible_host=X.X.X.X

#These are global variables for the group firewalls
[firewalls_checkpoint:vars]
ansible_httpapi_use_ssl=True
ansible_httpapi_validate_certs=False
ansible_user=admin
ansible_password=XXXXX
ansible_network_os=check_point.mgmt.checkpoint
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2020 19:47:00 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101382#M397</guid>
      <dc:creator>Jim_Oqvist</dc:creator>
      <dc:date>2020-11-07T19:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Issue creating a host with Ansible</title>
      <link>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101383#M398</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for replying, the ckp_sms is indeed resolving to my IP address. I set this in my host file (windows host file).&lt;/P&gt;&lt;P&gt;My SMS is R80.30.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2020 19:53:15 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101383#M398</guid>
      <dc:creator>mervin16</dc:creator>
      <dc:date>2020-11-07T19:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Issue creating a host with Ansible</title>
      <link>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101392#M402</link>
      <description>&lt;P&gt;Okay, please take a look at my response here, I think there is a problem with the Ansible httpapi connection plugin.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.checkpoint.com/t5/Ansible/Ansible-Connection-Error/m-p/101387/highlight/true#M400" target="_self"&gt;https://community.checkpoint.com/t5/Ansible/Ansible-Connection-Error/m-p/101387/highlight/true#M400&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2020 21:54:42 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101392#M402</guid>
      <dc:creator>Jim_Oqvist</dc:creator>
      <dc:date>2020-11-07T21:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Issue creating a host with Ansible</title>
      <link>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101411#M404</link>
      <description>&lt;P&gt;This solution worked with my R80.40 but not my R80.30.&lt;/P&gt;&lt;P&gt;Does it have something to do with a JHF that has not been installed ?&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 10:17:08 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101411#M404</guid>
      <dc:creator>mervin16</dc:creator>
      <dc:date>2020-11-08T10:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Issue creating a host with Ansible</title>
      <link>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101436#M405</link>
      <description>&lt;P&gt;To orchestrate R80.30 version with Ansible, you need JHF 135 or later installed.&lt;/P&gt;
&lt;P&gt;You can find more information here:&lt;/P&gt;
&lt;P&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk114661&amp;amp;partition=Basic&amp;amp;product=Security" target="_self"&gt;https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk114661&amp;amp;partition=Basic&amp;amp;product=Security&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 19:21:46 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Issue-creating-a-host-with-Ansible/m-p/101436#M405</guid>
      <dc:creator>Jim_Oqvist</dc:creator>
      <dc:date>2020-11-08T19:21:46Z</dc:date>
    </item>
  </channel>
</rss>

