<?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 PlayBook error in MDS in Ansible</title>
    <link>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253186#M846</link>
    <description>&lt;P&gt;Where are you variables required for the Check Point modules?&lt;/P&gt;
&lt;P&gt;It could be that you're missing the ansible_checkpoint_domain variable which states what Domain you want to create the hosts in. Without stating the target domain, Ansible will create the hosts in the System domain for the MDS which are not viewable in SmartConsole.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Vars example:&lt;/P&gt;
&lt;P&gt;vars:&lt;BR /&gt;ansible_connection: httpapi&lt;BR /&gt;ansible_httpapi_use_ssl: True&lt;BR /&gt;ansible_httpapi_validate_certs: False&lt;BR /&gt;ansible_network_os: check_point.mgmt.checkpoint #Using Galaxy &lt;A href="https://galaxy.ansible.com/check_point" target="_blank"&gt;https://galaxy.ansible.com/check_point&lt;/A&gt; collection&lt;BR /&gt;ansible_checkpoint_domain: Customer1 #Replace with your target domain name, or "Global" to target the global domain.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Jul 2025 12:24:58 GMT</pubDate>
    <dc:creator>Erik_Lagzdins</dc:creator>
    <dc:date>2025-07-15T12:24:58Z</dc:date>
    <item>
      <title>Ansible PlayBook error in MDS</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253123#M843</link>
      <description>&lt;P&gt;Hello, Community.&lt;/P&gt;
&lt;P&gt;I am new with using Ansible to automate tasks on a Check Point MDS.&lt;/P&gt;
&lt;P&gt;I have managed to create a PlayBook, which “apparently” works, because when I run the playbook from my Rocky Linux (Ansible), I don't get any errors.&lt;/P&gt;
&lt;P&gt;My problem is that the objects that I create through the PlayBook, do not appear in the “visual” part of the SmartConsole.&lt;/P&gt;
&lt;P&gt;The PlayBook tries to create 5 new objects, which are already created, but when you look for them in the SmartConsole, they do not appear.&lt;/P&gt;
&lt;P&gt;Is this normal?&lt;BR /&gt;Is there a setting I should use?&lt;/P&gt;
&lt;P&gt;Thanks for your comments.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2025 20:41:26 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253123#M843</guid>
      <dc:creator>Matlu</dc:creator>
      <dc:date>2025-07-14T20:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible PlayBook error in MDS</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253133#M844</link>
      <description>&lt;P&gt;Does your playbook publish?&lt;BR /&gt;Without that, no one else will be able to see the changes.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.ansible.com/ansible/latest/collections/check_point/mgmt/cp_mgmt_publish_module.html#ansible-collections-check-point-mgmt-cp-mgmt-publish-module" target="_blank"&gt;https://docs.ansible.com/ansible/latest/collections/check_point/mgmt/cp_mgmt_publish_module.html#ansible-collections-check-point-mgmt-cp-mgmt-publish-module&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2025 22:37:16 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253133#M844</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2025-07-14T22:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible PlayBook error in MDS</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253134#M845</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Currently, my Playbook has the following content.&lt;/P&gt;
&lt;P&gt;[srvrocky@localhost ansible-mdsmgmt]$ cat test-login.yml &lt;BR /&gt;---&lt;BR /&gt;- name: Eliminar host-demo y crear 5 nuevos hosts&lt;BR /&gt;hosts: mds&lt;BR /&gt;gather_facts: no&lt;BR /&gt;tasks:&lt;/P&gt;
&lt;P&gt;- name: Eliminar host-demo si existe&lt;BR /&gt;check_point.mgmt.cp_mgmt_host:&lt;BR /&gt;name: "host-demo"&lt;BR /&gt;state: "absent"&lt;BR /&gt;auto_publish_session: true&lt;BR /&gt;ignore_errors: yes&lt;/P&gt;
&lt;P&gt;- name: Crear 5 nuevos objetos tipo host&lt;BR /&gt;check_point.mgmt.cp_mgmt_host:&lt;BR /&gt;name: "{{ item.name }}"&lt;BR /&gt;ip_address: "{{ item.ip }}"&lt;BR /&gt;auto_publish_session: true&lt;BR /&gt;loop:&lt;BR /&gt;- { name: "host-demo-01", ip: "192.0.2.101" }&lt;BR /&gt;- { name: "host-demo-02", ip: "192.0.2.102" }&lt;BR /&gt;- { name: "host-demo-03", ip: "192.0.2.103" }&lt;BR /&gt;- { name: "host-demo-04", ip: "192.0.2.104" }&lt;BR /&gt;- { name: "host-demo-05", ip: "192.0.2.105" }&lt;/P&gt;
&lt;P&gt;- name: Mostrar mensaje final&lt;BR /&gt;ansible.builtin.debug:&lt;BR /&gt;msg: "Se eliminaron objetos antiguos y se crearon 5 nuevos hosts."&lt;BR /&gt;[srvrocky@localhost ansible-mdsmgmt]$&lt;BR /&gt;&lt;BR /&gt;The Playbook works well “apparently” because I don't get any error, but when I go to the SmartConsole to check, the new objects created do not appear.&lt;BR /&gt;&lt;BR /&gt;Gracias por los comentarios.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2025 22:44:16 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253134#M845</guid>
      <dc:creator>Matlu</dc:creator>
      <dc:date>2025-07-14T22:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible PlayBook error in MDS</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253186#M846</link>
      <description>&lt;P&gt;Where are you variables required for the Check Point modules?&lt;/P&gt;
&lt;P&gt;It could be that you're missing the ansible_checkpoint_domain variable which states what Domain you want to create the hosts in. Without stating the target domain, Ansible will create the hosts in the System domain for the MDS which are not viewable in SmartConsole.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Vars example:&lt;/P&gt;
&lt;P&gt;vars:&lt;BR /&gt;ansible_connection: httpapi&lt;BR /&gt;ansible_httpapi_use_ssl: True&lt;BR /&gt;ansible_httpapi_validate_certs: False&lt;BR /&gt;ansible_network_os: check_point.mgmt.checkpoint #Using Galaxy &lt;A href="https://galaxy.ansible.com/check_point" target="_blank"&gt;https://galaxy.ansible.com/check_point&lt;/A&gt; collection&lt;BR /&gt;ansible_checkpoint_domain: Customer1 #Replace with your target domain name, or "Global" to target the global domain.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2025 12:24:58 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253186#M846</guid>
      <dc:creator>Erik_Lagzdins</dc:creator>
      <dc:date>2025-07-15T12:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible PlayBook error in MDS</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253368#M847</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/4997"&gt;@Erik_Lagzdins&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;A doubt, is it possible to ‘feed’ a playbook with a source that is a file for example but in csv extension or a notepad or some other format, that will help me to update the content of what I need?&lt;/P&gt;
&lt;P&gt;I explain below.&lt;/P&gt;
&lt;P&gt;If your playbook works, but you need to update it daily with new data, for example, you have a playbook that you create massive IPs, but this is daily, today for example you create 50 IPs, and tomorrow you get a file with 80 new IPs&lt;/P&gt;
&lt;P&gt;Is it always necessary to ‘edit’ the playbook file manually and place those 80 new IPs, or is there a way to ‘upload’ a file to the playbook?&lt;/P&gt;
&lt;P&gt;I hope my doubt is well explained&lt;/P&gt;
&lt;P&gt;Basically I would like to understand how I could update the playbook with daily information without the need to edit the file manually every time it is needed&lt;/P&gt;
&lt;P&gt;Thanks for your comments.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 12:33:33 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253368#M847</guid>
      <dc:creator>Matlu</dc:creator>
      <dc:date>2025-07-17T12:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible PlayBook error in MDS</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253375#M848</link>
      <description>&lt;P&gt;Yes it is possible. As a Professional Services engineer this is directly related to a project I am involved with. A problem like this would be too complicated to solve over a Check Mates post, but I'll share the high level steps.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This solution requires 2x playbooks, 1 for retrieving the data from a server, 1 for applying the changes to a Check Point server.&lt;/P&gt;
&lt;P&gt;1. In the first playbook, use a "Get" request to retrieve new host object data from a webserver with the built-in ansible uri module, preferably in json format.&amp;nbsp;Register the host object data, and&amp;nbsp;use a set_fact task to be able to reuse the data for the next task.&lt;/P&gt;
&lt;P&gt;2. In a second playbook, use the cp_mgmt host modules to create new hosts based on the data you retrieved and registered from the first task.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The challenging parts are making sure the object data is available on the webserver in the correct format, and figuring out the syntax to use a loop with the cp_mgmt_host module.&lt;/P&gt;
&lt;P&gt;To simplify, you can skip step 1 completely by manually adding and editing a "vars_files" in the 2nd playbook to point to a json file with your host object data prior to running the playbook.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 14:07:10 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253375#M848</guid>
      <dc:creator>Erik_Lagzdins</dc:creator>
      <dc:date>2025-07-17T14:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible PlayBook error in MDS</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253391#M849</link>
      <description>&lt;P&gt;I have several doubts, but the first one I have when reading your recommendation is, do I need to involve a new server in my environment, to accomplish these tasks?&lt;/P&gt;
&lt;P&gt;A web server, as such?&lt;/P&gt;
&lt;P&gt;For example, I am now in a lab environment testing all this.&lt;/P&gt;
&lt;P&gt;And I only have my MDS management PC, my MDS, and my Rocky Linux (where is the Ansible)&lt;/P&gt;
&lt;P&gt;So, to achieve "having 2 Playbooks" for this goal, I would need to add in my environment a server that works as a web server, where is the available information of the new IP mass creation requests?&lt;/P&gt;
&lt;P&gt;I did not understand this part very well.&lt;/P&gt;
&lt;P&gt;It is a bit cumbersome.&lt;/P&gt;
&lt;P&gt;My problem or better said, the detail that I have, is that the request that I have is massive in an "almost daily" way&lt;/P&gt;
&lt;P&gt;Today 20 new IPs arrive, tomorrow 30, the day after tomorrow 70, and so on (Some days can arrive only 2, or 5 IPs) is something unpredictable&lt;/P&gt;
&lt;P&gt;But to think about "editing" the Playbook manually each time that a new request arrives, is quite manual and little automated, don't you think?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 16:29:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253391#M849</guid>
      <dc:creator>Matlu</dc:creator>
      <dc:date>2025-07-17T16:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible PlayBook error in MDS</title>
      <link>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253394#M850</link>
      <description>&lt;P&gt;I assumed the host information was coming from an external server already. If that's not the case, then you don't need to fetch data but you still need to tell Ansible about the updated host data each day. There are multiple solutions, it depends on what is easiest in your environment.&lt;/P&gt;
&lt;P&gt;1. Update the vars_file filename in the playbook on each execution.&lt;/P&gt;
&lt;P&gt;2. Replace the entire host data in the vars_file itself, that way the playbook never needs to be edited since the input filename will be static.&lt;/P&gt;
&lt;P&gt;3. Use an extra on-demand variable for the filename with the updated host data. This would be my preferred solution in a simple setup.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I attached examples of very simple host data and a playbook that you should be able to build off of.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;---
- name: Host Creation Playbook
  gather_facts: no
  hosts: mds
  vars:
    ansible_python_interpreter: /usr/bin/python3
    ansible_connection: httpapi
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_network_os: check_point.mgmt.checkpoint
    ansible_checkpoint_domain: Domain1
    ansible_ssh_user: cpadmin
    ansible_ssh_password: vpn123
  vars_files:
    - /home/user1/host_object_data.json
  tasks:
    - name: Configure hosts
      cp_mgmt_host:
        state: "{{item.state}}"
        color: "{{item.color}}"
        name: "{{item.name}}"
        ip_address: "{{item.ip_address}}"
        auto_publish_session: true
      loop: "{{ cp_mgmt_host_tasks }}"
      ignore_errors: yes
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 17 Jul 2025 17:33:24 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Ansible-PlayBook-error-in-MDS/m-p/253394#M850</guid>
      <dc:creator>Erik_Lagzdins</dc:creator>
      <dc:date>2025-07-17T17:33:24Z</dc:date>
    </item>
  </channel>
</rss>

