-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module external_usergroup is not idempotent #956
Comments
I think the problem is that you're pointing at an "EXTERNAL" group, but the module only matches "LDAP" ones. Can you please try the following patch and set the diff --git plugins/modules/external_usergroup.py plugins/modules/external_usergroup.py
index b3e52ff6..4b68aca1 100644
--- plugins/modules/external_usergroup.py
+++ plugins/modules/external_usergroup.py
@@ -83,7 +83,9 @@ def main():
name=dict(required=True),
usergroup=dict(required=True),
auth_source_ldap=dict(required=True, type='entity', flat_name='auth_source_id', resource_type='auth_sources'),
+ auth_source_external=dict(required=True, type='entity', flat_name='auth_source_id', resource_type='auth_sources'),
),
+ mutually_exclusive=[['auth_source_ldap','auth_source_external']],
)
params = {"usergroup_id": module.foreman_params.pop('usergroup')} That's obviously not how it should be in the final version, but the quickest for testing right now. |
err, obviously the diff --git plugins/modules/external_usergroup.py plugins/modules/external_usergroup.py
index b3e52ff6..758e51ba 100644
--- plugins/modules/external_usergroup.py
+++ plugins/modules/external_usergroup.py
@@ -82,8 +82,11 @@ def main():
foreman_spec=dict(
name=dict(required=True),
usergroup=dict(required=True),
- auth_source_ldap=dict(required=True, type='entity', flat_name='auth_source_id', resource_type='auth_sources'),
+ auth_source_ldap=dict(required=False, type='entity', flat_name='auth_source_id', resource_type='auth_sources'),
+ auth_source_external=dict(required=False, type='entity', flat_name='auth_source_id', resource_type='auth_sources'),
),
+ mutually_exclusive=[['auth_source_ldap','auth_source_external']],
+ required_one_of=[['auth_source_ldap','auth_source_external']],
)
params = {"usergroup_id": module.foreman_params.pop('usergroup')} |
Fixes: theforeman#956 Obsoletes: theforeman#955
Fixes: theforeman#956 Obsoletes: theforeman#955
Let's see if #959 fixes this. @Thulium-Drake can you give that PR a try in your env? |
I will, I'll get back to you tonight! |
Will be fixed with #959 :-) |
* external_usergroup: support non-LDAP groups Fixes: theforeman#956 Obsoletes: theforeman#955 * include FreeIPA example * make invisible a boolean flag instead of a type * use lookup_entity instead of auto_lookup_entities * use module.run()
SUMMARY
Running the external_usergroup module multiple times always shows a change
ISSUE TYPE
ANSIBLE VERSION
Ansible controller is Debian 10 (Buster)
KATELLO/FOREMAN VERSION
Foreman/Katello is installed on CentOS7
APYPIE VERSION
STEPS TO REPRODUCE
EXPECTED RESULTS
No changes after the first run
ACTUAL RESULTS
None of the info below is privileged, this is in my lab environment.
The text was updated successfully, but these errors were encountered: