Just a "messenger", but here is what AI gave...
**********
You're very close — the problem is with how the security-zone-settings field is structured in the cp_mgmt_simple_gateway module.
In the Check Point Management API (and Ansible collection check_point.mgmt), the correct field names and hierarchy are slightly different from what you used. The field security-zone-settings expects a dictionary, and the correct key for assigning a specific zone is specific-zone, not "specific-zone": "value" — and you must not use both security-zone and security-zone-settings together incorrectly.
Let’s fix it step by step 👇
✅ Corrected Playbook Example
- name: Update security zone for interface
check_point.mgmt.cp_mgmt_simple_gateway:
name: gw-893628
interfaces:
- name: eth0
security_zone_settings:
specific_zone: "{{ security_zone }}"
state: present
register: update_result
- debug:
msg: "{{ update_result }}"
⚙️ Key Points
-
Use underscores instead of hyphens in YAML keys for Ansible modules (Python interprets field names with underscores).
-
✅ security_zone_settings
-
🚫 security-zone-settings
-
Nested structure:
-
You don’t need the line security-zone: true; that flag doesn’t exist in this context.
✅ Example with a bonding interface
If your interface is a bonding interface, just specify the bond name:
- name: Update security zone for bond interface
check_point.mgmt.cp_mgmt_simple_gateway:
name: gw-893628
interfaces:
- name: bond0
security_zone_settings:
specific_zone: "Internal_Zone"
state: present
🔍 Optional: Force an update
Sometimes, Check Point’s API won’t mark a change unless you explicitly use ignore_warnings: true or ignore_errors: true:
check_point.mgmt.cp_mgmt_simple_gateway:
name: gw-893628
interfaces:
- name: eth0
security_zone_settings:
specific_zone: "{{ security_zone }}"
state: present
ignore_warnings: true
✅ Summary
| Wrong Key |
Correct Key |
Notes |
security-zone-settings |
security_zone_settings |
Use underscores |
"specific-zone": "{{ security_zone }}" |
specific_zone: "{{ security_zone }}" |
No quotes or hyphen |
security-zone: true |
(remove) |
Not needed |
Would you like me to show a full playbook example including session login/logout (cp_mgmt_login / cp_mgmt_publish/ cp_mgmt_logout)? That’s often required for changes to persist.
Best,
Andy