Replying to myself, borderline necro-posting...
The steps from @Joseph_Audet are 100% correct. I confirmed on my R81.20 management server.
For CloudGuard R81.20 gateways, however, the new templates deploy an NSG (presumably for NSG flow logs?), but the default NSG doesn't allow inbound connections other than SSH. This was blocking my initial attempts. After adding a rule to allow traffic, it works.
EDIT: The NSG item was my issue; I was detaching the public IP and upgrading it to Standard SKU for a future Standard SKU front-end load-balancer for a single gateway deployment. Using the azure_rm_networkinterface module pushed the config to the Azure API controller with implicit attribute of "create_with_security_group: true", which created a new NSG allowing only SSH and attached it to the interface. This caused some issues. 🙂 I revised my playbook to add "create_with_security_group: '{{ vmName }}-nsg'" which associates the CloudGuard deployment-created NSG (I could have done "false", but to achieve NSG flow logs, an NSG must be assigned). After that was corrected, the revised Ansible sequence below worked as-is, without reset-sic/test-sic-status; which is the desired, intended, and expected result.
My Ansible playbook sequence:
- name: Add gateway
check_point.mgmt.cp_mgmt_simple-gateway:
name: "{{ gw_item }}"
one_time_password: "{{ ckp_sic_key }}"
... other parameters...
- name: Publish
check_point.mgmt.cp_mgmt_publish:
wait_for_task: true
- name: View SIC status
debug:
msg: "{{ gw_sic_status }}"
#ItWorksNow