<?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 Remove all members from object in Ansible</title>
    <link>https://community.checkpoint.com/t5/Ansible/Remove-all-members-from-object/m-p/161849#M696</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I want to remove all members of an object and I could really need some help atm.&lt;/P&gt;&lt;P&gt;To create the object I have the following task (example application site groups)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    - name: set application groups
      check_point.mgmt.cp_mgmt_application_site_group:
        name: "{{ item.Name }}"
        comments: "{{ item.Comments }}"
        members: "{{ item.Members }}"
      with_items: "{{ cp_application_groups }}"
      loop: "{{ cp_application_groups if cp_application_groups is iterable else []}}"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;A creation was made with the following object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;- Name: custom-group
  Comments: Custom test
  Members:
  - File Storage and Sharing&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When removing the entry of the members or replace it with an "- []", I get the following error message "Requested object [] not found"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;- Name: custom-group
  Comments: Custom test
  Members:
  - [] # or remove it entirely&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me on this?&lt;/P&gt;</description>
    <pubDate>Fri, 11 Nov 2022 10:35:19 GMT</pubDate>
    <dc:creator>User1234</dc:creator>
    <dc:date>2022-11-11T10:35:19Z</dc:date>
    <item>
      <title>Remove all members from object</title>
      <link>https://community.checkpoint.com/t5/Ansible/Remove-all-members-from-object/m-p/161849#M696</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I want to remove all members of an object and I could really need some help atm.&lt;/P&gt;&lt;P&gt;To create the object I have the following task (example application site groups)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    - name: set application groups
      check_point.mgmt.cp_mgmt_application_site_group:
        name: "{{ item.Name }}"
        comments: "{{ item.Comments }}"
        members: "{{ item.Members }}"
      with_items: "{{ cp_application_groups }}"
      loop: "{{ cp_application_groups if cp_application_groups is iterable else []}}"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;A creation was made with the following object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;- Name: custom-group
  Comments: Custom test
  Members:
  - File Storage and Sharing&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When removing the entry of the members or replace it with an "- []", I get the following error message "Requested object [] not found"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;- Name: custom-group
  Comments: Custom test
  Members:
  - [] # or remove it entirely&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me on this?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 10:35:19 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Remove-all-members-from-object/m-p/161849#M696</guid>
      <dc:creator>User1234</dc:creator>
      <dc:date>2022-11-11T10:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Remove all members from object</title>
      <link>https://community.checkpoint.com/t5/Ansible/Remove-all-members-from-object/m-p/162033#M697</link>
      <description>&lt;P&gt;In general, with Ansible, you describe the desired state, not the steps required to get to that state.&lt;BR /&gt;This creates a few issues when you're trying to manage objects with Ansible that were not created via Ansible.&lt;/P&gt;
&lt;P&gt;The only way to use Ansible to remove items from an existing group is:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Describe the group as it exists now in an Ansible playbook and run it&lt;/LI&gt;
&lt;LI&gt;Describe the group as you would like it to be in the Ansible playbook and run it&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Otherwise, you will need to use a different mechanism to remove items from the group (e.g. SmartConsole, the API).&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 15:34:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Remove-all-members-from-object/m-p/162033#M697</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2022-11-14T15:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Remove all members from object</title>
      <link>https://community.checkpoint.com/t5/Ansible/Remove-all-members-from-object/m-p/162036#M698</link>
      <description>&lt;P&gt;Hey!&lt;BR /&gt;&lt;BR /&gt;The objects have been created via ansible and I want to change them now. Therefore I have an object which had members, and I just wanna clear out all members now.&lt;/P&gt;&lt;P&gt;Desired state yesterday:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;- Name: custom-group
  Comments: Custom test
  Members:
  - File Storage and Sharing&lt;/LI-CODE&gt;&lt;P&gt;Desired state today:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;- Name: custom-group
  Comments: Custom test&lt;/LI-CODE&gt;&lt;P&gt;The problem is, not mentioning "Members" does not delete them, but does not touch any members in the group. Is there no way to remove all members from a group via ansible?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 15:39:46 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Remove-all-members-from-object/m-p/162036#M698</guid>
      <dc:creator>User1234</dc:creator>
      <dc:date>2022-11-14T15:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Remove all members from object</title>
      <link>https://community.checkpoint.com/t5/Ansible/Remove-all-members-from-object/m-p/162042#M699</link>
      <description>&lt;P&gt;Was the group itself created via Ansible? Yes or no.&lt;BR /&gt;If the group wasn't created by Ansible, then it may not be possible to remove items from it even if the items were added via Ansible later.&lt;BR /&gt;Paging&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/42080"&gt;@chkp-royl&lt;/a&gt;&amp;nbsp;to clarify.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 15:44:42 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Remove-all-members-from-object/m-p/162042#M699</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2022-11-14T15:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Remove all members from object</title>
      <link>https://community.checkpoint.com/t5/Ansible/Remove-all-members-from-object/m-p/162049#M700</link>
      <description>&lt;P&gt;Yes, the group itself was created via ansible&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 16:03:19 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Remove-all-members-from-object/m-p/162049#M700</guid>
      <dc:creator>User1234</dc:creator>
      <dc:date>2022-11-14T16:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Remove all members from object</title>
      <link>https://community.checkpoint.com/t5/Ansible/Remove-all-members-from-object/m-p/162071#M701</link>
      <description>&lt;P&gt;Has the group been modified by anything outside of Ansible?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 18:10:42 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Remove-all-members-from-object/m-p/162071#M701</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2022-11-14T18:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Remove all members from object</title>
      <link>https://community.checkpoint.com/t5/Ansible/Remove-all-members-from-object/m-p/162093#M702</link>
      <description>&lt;P&gt;No. I am only refering to ansible created and modified, and system objects. No "manual" objects via Smart Console.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 06:58:35 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Ansible/Remove-all-members-from-object/m-p/162093#M702</guid>
      <dc:creator>User1234</dc:creator>
      <dc:date>2022-11-15T06:58:35Z</dc:date>
    </item>
  </channel>
</rss>

