<?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: Adding and removing in Ansible in Ansible</title>
    <link>https://community.checkpoint.com/t5/Ansible/Adding-and-removing-in-Ansible/m-p/98040#M384</link>
    <description>&lt;P&gt;Hi Hugo,&lt;/P&gt;
&lt;P&gt;You can use the parameter&lt;BR /&gt;ignore_warnings: true&lt;BR /&gt;&lt;A href="https://docs.ansible.com/ansible/latest/collections/check_point/mgmt/cp_mgmt_host_module.html#ansible-collections-check-point-mgmt-cp-mgmt-host-module" target="_self"&gt;ansible-collections-check-point-mgmt-cp-mgmt-host-module&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2020-10-02_08-54-47.png" style="width: 597px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/8238i0744CB46D81948C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="2020-10-02_08-54-47.png" alt="2020-10-02_08-54-47.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This will ignore any warnings when deleting an object and publish the change, for example deleting a host that is used in a group like in your situation.&lt;/P&gt;
&lt;P&gt;Due to an issue, this this parameter is not honored in the current module.&lt;BR /&gt;R&amp;amp;D have found the root cause and this will be fixed in the next version of the collection.&lt;/P&gt;
&lt;P&gt;Remember to always use the latest updated collection available here:&lt;BR /&gt;&lt;A href="https://galaxy.ansible.com/check_point/mgmt" target="_self"&gt;https://galaxy.ansible.com/check_point/mgmt&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You can find information about the updates in the different releases of the collection here:&lt;BR /&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" href="https://github.com/CheckPointSW/CheckPointAnsibleMgmtCollection/releases" target="_self"&gt;https://github.com/CheckPointSW/CheckPointAnsibleMgmtCollection/releases&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Kind Regards&lt;BR /&gt;Jim&lt;/P&gt;</description>
    <pubDate>Fri, 02 Oct 2020 06:58:35 GMT</pubDate>
    <dc:creator>Jim_Oqvist</dc:creator>
    <dc:date>2020-10-02T06:58:35Z</dc:date>
    <item>
      <title>Adding and removing in Ansible</title>
      <link>https://community.checkpoint.com/t5/Ansible/Adding-and-removing-in-Ansible/m-p/97805#M382</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I find that nsible gives me a bit of a headache. I can add objects without a problem by using "state: present" but if I set all objects to "state: absent" I run into dependency issue.&lt;/P&gt;
&lt;P&gt;My current playbook I am testing with is:&lt;/P&gt;
&lt;P&gt;---&lt;BR /&gt;- name: Create Objects&lt;BR /&gt;&amp;nbsp; hosts: cpmgmt&lt;BR /&gt;&amp;nbsp; connection: httpapi&lt;BR /&gt;&amp;nbsp; tasks:&lt;BR /&gt;&amp;nbsp; - name: Subnet NET-TEST-1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; check_point.mgmt.cp_mgmt_network:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; name: "NET-TEST-1"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; subnet: "192.168.1.0"&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; mask_length: 24&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; color: red&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; state: present&lt;/P&gt;
&lt;P&gt;&amp;nbsp; - name: Subnet NET-TEST-2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; check_point.mgmt.cp_mgmt_network:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; name: "NET-TEST-2"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; subnet: "192.168.2.0"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; mask_length: 24&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; color: purple&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; state: present&lt;BR /&gt;&amp;nbsp; - name: Subnet NET-TEST-3&lt;BR /&gt;&amp;nbsp; &amp;nbsp; check_point.mgmt.cp_mgmt_network:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; name: "NET-TEST-3"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; subnet: "192.168.3.0"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; mask_length: 24&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; color: blue&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; state: present&lt;/P&gt;
&lt;P&gt;&amp;nbsp; - name: Group GRP-NET-TEST&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;cp_mgmt_group:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; name: GRP-NET-TEST&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; members:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - NET-TEST-1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - NET-TEST-2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - NET-TEST-3&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; color: dark gold&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; state: present&lt;/P&gt;
&lt;P&gt;&amp;nbsp; - name: Publish&lt;BR /&gt;&amp;nbsp; &amp;nbsp; check_point.mgmt.cp_mgmt_publish:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So somehow you also need to change the order of the tasks if you want to delete objects. And that would defeat the purpose of ansible in my view.&lt;/P&gt;
&lt;P&gt;So how do other handle playbooks like this?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:52:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Adding-and-removing-in-Ansible/m-p/97805#M382</guid>
      <dc:creator>Hugo_vd_Kooij</dc:creator>
      <dc:date>2020-09-29T13:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Adding and removing in Ansible</title>
      <link>https://community.checkpoint.com/t5/Ansible/Adding-and-removing-in-Ansible/m-p/98017#M383</link>
      <description>&lt;P&gt;Tagging&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/41271"&gt;@Or_Soffer&lt;/a&gt;&amp;nbsp;in case he has some feedback around this.&lt;/P&gt;
&lt;P&gt;Part of the issue here is making sure we don't undo changes made by humans.&lt;BR /&gt;Which is why removing, say, a group that previously existed before Ansible was in use is not something we allow.&lt;BR /&gt;However, this seems like a pretty clear-cut case where Ansible is creating/removing all the relevant objects, so it...should work.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 16:08:10 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Adding-and-removing-in-Ansible/m-p/98017#M383</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2020-10-01T16:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Adding and removing in Ansible</title>
      <link>https://community.checkpoint.com/t5/Ansible/Adding-and-removing-in-Ansible/m-p/98040#M384</link>
      <description>&lt;P&gt;Hi Hugo,&lt;/P&gt;
&lt;P&gt;You can use the parameter&lt;BR /&gt;ignore_warnings: true&lt;BR /&gt;&lt;A href="https://docs.ansible.com/ansible/latest/collections/check_point/mgmt/cp_mgmt_host_module.html#ansible-collections-check-point-mgmt-cp-mgmt-host-module" target="_self"&gt;ansible-collections-check-point-mgmt-cp-mgmt-host-module&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2020-10-02_08-54-47.png" style="width: 597px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/8238i0744CB46D81948C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="2020-10-02_08-54-47.png" alt="2020-10-02_08-54-47.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This will ignore any warnings when deleting an object and publish the change, for example deleting a host that is used in a group like in your situation.&lt;/P&gt;
&lt;P&gt;Due to an issue, this this parameter is not honored in the current module.&lt;BR /&gt;R&amp;amp;D have found the root cause and this will be fixed in the next version of the collection.&lt;/P&gt;
&lt;P&gt;Remember to always use the latest updated collection available here:&lt;BR /&gt;&lt;A href="https://galaxy.ansible.com/check_point/mgmt" target="_self"&gt;https://galaxy.ansible.com/check_point/mgmt&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You can find information about the updates in the different releases of the collection here:&lt;BR /&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" href="https://github.com/CheckPointSW/CheckPointAnsibleMgmtCollection/releases" target="_self"&gt;https://github.com/CheckPointSW/CheckPointAnsibleMgmtCollection/releases&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Kind Regards&lt;BR /&gt;Jim&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 06:58:35 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Adding-and-removing-in-Ansible/m-p/98040#M384</guid>
      <dc:creator>Jim_Oqvist</dc:creator>
      <dc:date>2020-10-02T06:58:35Z</dc:date>
    </item>
  </channel>
</rss>

