- Products
- Learn
- Local User Groups
- Partners
- More
Introduction to Lakera:
Securing the AI Frontier!
Quantum Spark Management Unleashed!
Check Point Named Leader
2025 Gartner® Magic Quadrant™ for Hybrid Mesh Firewall
HTTPS Inspection
Help us to understand your needs better
CheckMates Go:
SharePoint CVEs and More!
Hi all,
I have a problem when I try to remove an Host object from a Group of objects.
For example, I have a group with this members:
Group_1:
- Host_1.1.1.1
- Host_2.2.2.2
- Host_3.3.3.3
- Host_4.4.4.4
And I want to remove the object "Host_3.3.3.3" from that "Group_1".
The logic from my playbook is:
1 - To get all members from that group and save them inside a list.
list = [Host_1.1.1.1, Host_2.2.2.2, Host_3.3.3.3, Host_4.4.4.4]
2 - Remove from that list, the object that I want to delete.
list = [Host_1.1.1.1, Host_2.2.2.2, Host_4.4.4.4]
3 - Call "cp_mgmt_group" module and set the members parameter with the list. I am editing the Group object with a new list of members.
cp_mgmt_group:
name: Group_1
members: "{{ list }}"
state: present
auto_publish_session: yes
All playbook runs OK, but when I go to the SmartConsole to see the changes, the "Group_1" still having the object "Host_3.3.3.3" that I removed with the Ansible playbook.
I publish all changes in the playbook, and install the policy successfuly. And also, I have checked that the steps 1 and 2 works fine.
In other playbooks, I follow the same logic when I want to add some new object to the group, changing the second step by Add to that list the new object, and it works fine. Why when I pass the list with less members, the action doesn't work?
Does "cp_mgmt_group" module support to delete just one object inside of it? Or is there any simple way to do this? Any comment will be appreciated.
Thanks
I reply myself, but unfortunately not with the final answer.
I think that the problem is related with the fact that as the members already exists in the group, the module doesn't make any change (See the"changed": false ) even if I am passing less members than the members that already have the group at that time.
"cp_mgmt_group" output:
ok: [fw] => {
"changed": false,
"checkpoint_session_uid": "1ae46488-c031-4426-b7df-ff435f81a5c3",
"invocation": {
"module_args": {
"auto_publish_session": true,
"color": null,
"comments": null,
"details_level": null,
"groups": null,
"ignore_errors": null,
"ignore_warnings": null,
"members": [
"Host_1.1.1.1",
"Host_1.1.1.2",
"Host_1.1.1.4"
],
"name": "Group1",
"state": "present",
"tags": null,
"version": null,
"wait_for_task": true
}
}
}
Could be any other form to remove that object from the group or to force the module to make the changes?
Thanks
-What version of Check Point management?
I have installed the Check_Point_R80_10_JUMBO_HF_Bundle_T259 a few weeks ago:
FW> fw ver
This is Check Point's software version R80.10 - Build 223
FW> fwm ver
This is Check Point Security Management Server R80.10 - Build 054
-What errors (if any) are shown when you try and run the playbook after you've removed Host_1.1.1.3 from it?
There is no error while running the playbook.
-Also, what does $FWDIR/log/api.elg say?
Follow the log when I try to remove object "Block_1.1.1.2" from the group "Blacklist" that contains the members ["Block_1.1.1.1", "Block_1.1.1.2", "Block_1.1.1.3", "Block_1.1.1.4", "Block_1.1.1.5", "Block_1.1.1.6"]
I'm using the module cp_mgmt_group passing all objects except the object I want to remove.
--------------------------------------
2020-04-20 11:11:05,407 INFO org.apache.cxf.interceptor.LoggingInInterceptor.log:250 [qtp1746170792-30] - Inbound Message
----------------------------
ID: 922
Address: http://127.0.0.1:50276/web_api/equals
Encoding: ISO-8859-1
Http-Method: POST
Content-Type: application/json
Headers: {accept-encoding=[identity], connection=[keep-alive], Content-Length=[148], content-type=[application/json], Host=[127.0.0.1:50276], User-Agent=[Python-urllib/3.6], X-Chkp-Sid=[fxH3s_SgVrU5ZACbmSo2Xvj0fM2N171NddKIQOdTeK0], X-Forwarded-For=[192.168.3.2], X-Forwarded-Host=[192.168.3.7:443], X-Forwarded-Host-Port=[443], X-Forwarded-Server=[192.168.3.7]}
Payload: {"params": {"name": "Blacklist", "members": ["Block_1.1.1.1", "Block_1.1.1.3", "Block_1.1.1.4", "Block_1.1.1.5", "Block_1.1.1.6"]}, "type": "group"}
--------------------------------------
2020-04-20 11:11:05,414 WARN com.checkpoint.management.web_api_is.utils.helpers.RequestHeadersHelper.getMediaType_aroundBody6:21 [qtp1746170792-30] - No Accept header received. Falling back to default media type [application/json].
2020-04-20 11:11:05,415 INFO com.checkpoint.management.web_api_is.utils.helpers.ApiCache.<init>:13 [qtp1746170792-30] - Cache created and initialized
2020-04-20 11:11:05,415 INFO com.checkpoint.management.web_api.web_services.WebApiEntryPoint.logRequestedCommandInfo:33 [qtp1746170792-30] - Executing [equals] of version 1.1 (references 1)
2020-04-20 11:11:05,655 INFO com.checkpoint.management.web_api_is.utils.CsvFileWriterUtils.writeCsvLine:3 [qtp1746170792-30] - 2020-04-20,11:11:05 +0200,equals,PASSED,241
2020-04-20 11:11:05,657 INFO org.apache.cxf.interceptor.LoggingOutInterceptor.log:250 [qtp1746170792-30] - Outbound Message
---------------------------
ID: 922
Response-Code: 200
Content-Type: application/json
Headers: {Content-Type=[application/json], Date=[Mon, 20 Apr 2020 09:11:05 GMT]}
Payload: {
"equals" : true
}
--------------------------------------
I think that the problem is related with the way that how Ansible works.
When you try to update the members of a group, if inside the members there is at least one new member that wasn't there before, the task "changes" the group object, adding the new member. (That works ok in my playbook)
But if inside the members there is no one new (because you only have removed one of them, the rest still there) it doesn't make any change because the members that you are trying to add now are already there, and nothing changes in the group object.
Maybe this logic is not valid.
I hope I have explained myself well.
Thank you
Thank you for your replies.
I have the latest JHF dated last month "take 272" (I'm not sure why it just displays "build 057") so it must be enough as it requires "take 270", right?
Check_Point_R80_10_JUMBO_HF_Bundle_T272_sk116380_FULL.tgz
The Security Gateway and the Security Management are on the same VM.
I've tried both ways: with a new group created by the Ansible playbook, and with an existing group created through the SmartConsole.
Unfortunately with the same result.
Hi @Sannet, sorry to dig up the topic.. I'am having the same issue and the only way to modify object in group for me, is using cp_mgmt_group with the present state and the members already existing in the group minus the object i don't want anymore... Is there any other solution ? More efficient ones ?
Again, by design.
There is no explicit "delete" command in Ansible, there is only adding and removing from the playbook and rerunning the playbook.
@PhoneBoy, thanks for your answer. Is there a will in the futur to make it work with a delete command ? Also, I think there is a way through the Smart Console API to do it ? Right ?
Our compagny have thousands of objects and thousands of groups, so i assume if i do the trick with ansible it will impact all the rules with these groups... This is not a solution for us 😕
Gary
Yes, it is possible to issue a delete command from the API and SmartConsole.
Ansible operates under the assumption it is entirely responsible for creating/removing the relevant infrastructure and configuration.
A direct "delete" operation from Ansible, therefore, doesn't make a lot of sense.
I don't understand why there is not an api and ansible command to delete a specific host from an specific group.
It is quite a limitation
Those kinds of operations are not consistent with the Ansible philosophy, which is why we do not provide them.
I provide a more detailed answer here:
https://community.checkpoint.com/t5/Ansible/Ansible-Add-Host-Object-to-Existing-Network-Group/m-p/12...
Leaderboard
Epsum factorial non deposit quid pro quo hic escorol.
Tue 07 Oct 2025 @ 10:00 AM (CEST)
Cloud Architect Series: AI-Powered API Security with CloudGuard WAFThu 09 Oct 2025 @ 10:00 AM (CEST)
CheckMates Live BeLux: Discover How to Stop Data Leaks in GenAI Tools: Live Demo You Can’t Miss!Thu 09 Oct 2025 @ 10:00 AM (CEST)
CheckMates Live BeLux: Discover How to Stop Data Leaks in GenAI Tools: Live Demo You Can’t Miss!Wed 22 Oct 2025 @ 11:00 AM (EDT)
Firewall Uptime, Reimagined: How AIOps Simplifies Operations and Prevents OutagesAbout CheckMates
Learn Check Point
Advanced Learning
YOU DESERVE THE BEST SECURITY