- Products
- Learn
- Local User Groups
- Partners
- More
MVP 2026: Submissions
Are Now Open!
What's New in R82.10?
Watch NowOverlap in Security Validation
Help us to understand your needs better
CheckMates Go:
Maestro Madness
Hi All
I am trying to do automation using Ansible(cp_mgmt_host) and am running into an issue with a call to delete a host. I am getting an error that the object I am trying to delete is part of some other groups. I have set the ignore_errors and ignore_warnings paramets to true in the cp_mgmt_host function so that the script can run if this condition is met. I am unable to move past because of this. Does the host need to be removed from the group first and if yes, I do not see that as an option in the cp_mgmt_group call? I am getting the below. I am trying to delete the object TESTHOST
"msg": {
"code": "err_validation_failed",
"message": "Validation failed with 1 warning",
"warnings": [
{
"message": "Object TESTHOST is used by the following objects: xxxxxxxx, yyyyyyyy"
Any help would be appreciated.
Thanks
Thanks Phoneboy. Let me explain further. I am using the cp_mgmt_host task of the Checkpoint ansible module to delete the host. One of the parameters it takes is "State" and the possible values are "Present" or "Absent". Present for addition and Absent for deletion. In addition, there are 2 other parameters "ignore_errors" and "ignore_warnings" which can be true or false.
I am doing the below in my playbook
- name: delete-host
cp_mgmt_host:
name: TESTHOST
ignore_errors: true
ignore_warnings: true
state: absent
Per the documentation, this is what is needed to delete the host and ignore any warnings or errors but I am unable to delete as the host is a member of a group object. My understanding from the documentation is that having ignore_errors set to true and state to "Absent" the host should be deleted.
What am I missing?
The host I am trying to delete was added by the ansible playbook to add host using the cp_mgmt_host library. This was set by setting the value of the variable "State" to "Present". I am now trying to delete the same host as a test to see how to do this via Ansible. So I am using the same cp_mgmt_host library and setting the "State" parameter to "absent" to delete it. The host I have added is part of 2 groups and I am trying to delete it and the message I am getting is that these objects belong to 2 groups. Below is the message I am getting
atal: [x.x.x.x]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"auto_publish_session": true,
"color": null,
"comments": null,
"details_level": null,
"groups": null,
"host_servers": null,
"ignore_errors": null,
"ignore_warnings": null,
"interfaces": null,
"ip_address": null,
"ipv4_address": null,
"ipv6_address": null,
"name": "TEST123",
"nat_settings": null,
"state": "absent",
"tags": null,
"version": null,
"wait_for_task": true
}
},
"msg": {
"code": "err_validation_failed",
"message": "Validation failed with 1 warning",
"warnings": [
{
"message": "Object TEST123 is used by the following objects: Domain-xxxxx-Group, OS-xxxxxxx-Server-Group"
}
]
}
}
Do I need to first find out what groups the host belongs to and take it out from the groups and then delete it? If I have to take it out of groups do I use the cp_mgmtgroup library and does have any example if they have used it as I am concerned that I do not want to delete the group by mistake.
Thanks
Leaderboard
Epsum factorial non deposit quid pro quo hic escorol.
| User | Count |
|---|---|
| 1 | |
| 1 |
Tue 16 Dec 2025 @ 05:00 PM (CET)
Under the Hood: CloudGuard Network Security for Oracle Cloud - Config and Autoscaling!Thu 18 Dec 2025 @ 10:00 AM (CET)
Cloud Architect Series - Building a Hybrid Mesh Security Strategy across cloudsTue 16 Dec 2025 @ 05:00 PM (CET)
Under the Hood: CloudGuard Network Security for Oracle Cloud - Config and Autoscaling!Thu 18 Dec 2025 @ 10:00 AM (CET)
Cloud Architect Series - Building a Hybrid Mesh Security Strategy across cloudsAbout CheckMates
Learn Check Point
Advanced Learning
YOU DESERVE THE BEST SECURITY