CheckPointSW / CheckPointAnsibleMgmtCollection

This Ansible collection provides control over a Check Point Management server using Check Point's web-services APIs.
https://galaxy.ansible.com/check_point/mgmt
Apache License 2.0
40 stars 30 forks source link

cp_mgmt_host, difference in groups parameter is not detected #65

Closed alex-barth closed 2 years ago

alex-barth commented 2 years ago

Hi,

we are using version 2.3.0 of the collection and a management server with R81, api version 1.7. When using the cp_mgmt_host module with the groups parameter, the module does not report changed (and does not change the object) for subsequent calls, when the only change is in groups.

playbook example:

---
- name: "Debug playbook"
  hosts: all
  gather_facts: no
  connection: httpapi
  vars:
    ansible_python_interpreter: auto

  tasks:
    - name: "Create group1"
      cp_mgmt_group:
        name: "test_group1"
        auto_publish_session: "true"

    - name: "Create group2"
      cp_mgmt_group:
        name: "test_group2"
        auto_publish_session: "true"

    - name: "Create host and add to group1"
      cp_mgmt_host:
        name: "test_host"
        ip_address: "1.1.1.1"
        groups: "test_group1"
        auto_publish_session: "true"

    - name: "Change group for host to group2" #<-- should report changed, but returns with "ok"
      cp_mgmt_host:
        name: "test_host"
        ip_address: "1.1.1.1"
        groups: "test_group2"
        auto_publish_session: "true"

and the playbook run:

PLAY [Debug playbook] ************************************************************************************************

TASK [Create group1] *************************************************************************************************
changed: [testmanagement]

TASK [Create group2] *************************************************************************************************
changed: [testmanagement]

TASK [Create host and add to group1] *********************************************************************************
changed: [testmanagement]

TASK [Change group for host to group2] *******************************************************************************
ok: [testmanagement]

PLAY RECAP ***********************************************************************************************************
testmanagement             : ok=4    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0 

result in smartconsole: image

Thanks Alex

chkp-shirango commented 2 years ago

Hi @alex-barth,

Thanks for reaching us. The jumbo release with the PRJ-18350 includes this fix.

Thanks, Shiran