Closed ephracis closed 5 years ago
Thanks for the reproducer steps. I roughly know why this is happening and am trying to get a fix for that ASAP.
@ephracis can you test #291 too please?
Tried it with #286 and the following tests:
- hosts: tests
gather_facts: false
tasks:
- name: Load server config
include_vars:
file: server_vars.yml
- include: tasks/auth_source_ldap.yml
vars:
auth_source_ldap_state: present
expected_change: true
- include: tasks/auth_source_ldap.yml
vars:
auth_source_ldap_state: present
auth_source_ldap_organizations: []
auth_source_ldap_locations: []
expected_change: true
- include: tasks/auth_source_ldap.yml
vars:
auth_source_ldap_state: present
expected_change: true
- include: tasks/auth_source_ldap.yml
vars:
auth_source_ldap_state: present
expected_change: false
- include: tasks/auth_source_ldap.yml
vars:
auth_source_ldap_state: absent
expected_change: true
- include: tasks/auth_source_ldap.yml
vars:
auth_source_ldap_state: absent
expected_change: false
It worked fine!
If you get #291 merged I can rebase #286 onto it with the extended tests.
SUMMARY
New modules based on Apypie does not seem to support changing associated resources such as organizations or locations. One example would be
foreman_domain
.This is because the API wants the POST/PUT params to be named
organization_ids
but the GET request returnsorganizations
. This causes the comparison inupdate_resource
(which iterates the params from GET) to miss the updated IDs.ISSUE TYPE
ANSIBLE VERSION
KATELLO/FOREMAN VERSION
NAILGUN VERSION
STEPS TO REPRODUCE
EXPECTED RESULTS
The tests should pass.
ACTUAL RESULTS
The tests fails because the module did not report changed when the list of associated organisations and locations were changed. Ocular inspection of Foreman shows that no change occurred and the domain remains unassociated.