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
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 thegroups
parameter, the module does not report changed (and does not change the object) for subsequent calls, when the only change is ingroups
.playbook example:
and the playbook run:
result in smartconsole:
Thanks Alex