From 595d590862f5fc88f37d5353332ab37ec4cbc225 Mon Sep 17 00:00:00 2001 From: justchris1 <30219018+justchris1@users.noreply.github.com> Date: Wed, 7 Apr 2021 14:57:04 -0400 Subject: [PATCH] Fix issue where multiselect field in userauthtype did not allow multiple values (#2174) * Fix issue where multiselect field in userauthtype did not allow multiple values * Add changelogfragment for change * Update changelogs/fragments/2174-ipa-user-userauthtype-multiselect.yml Co-authored-by: Felix Fontein * Update plugins/modules/identity/ipa/ipa_user.py Co-authored-by: Felix Fontein * Update changelogs/fragments/2174-ipa-user-userauthtype-multiselect.yml Co-authored-by: Felix Fontein Co-authored-by: Chris Costa Co-authored-by: Felix Fontein --- .../2174-ipa-user-userauthtype-multiselect.yml | 2 ++ plugins/modules/identity/ipa/ipa_user.py | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/2174-ipa-user-userauthtype-multiselect.yml diff --git a/changelogs/fragments/2174-ipa-user-userauthtype-multiselect.yml b/changelogs/fragments/2174-ipa-user-userauthtype-multiselect.yml new file mode 100644 index 0000000000..d162f19b7a --- /dev/null +++ b/changelogs/fragments/2174-ipa-user-userauthtype-multiselect.yml @@ -0,0 +1,2 @@ +minor_changes: + - ipa_user - fix ``userauthtype`` option to take in list of strings for the multi-select field instead of single string (https://github.com/ansible-collections/community.general/pull/2174). diff --git a/plugins/modules/identity/ipa/ipa_user.py b/plugins/modules/identity/ipa/ipa_user.py index 1a0c885cfb..847749f15e 100644 --- a/plugins/modules/identity/ipa/ipa_user.py +++ b/plugins/modules/identity/ipa/ipa_user.py @@ -94,7 +94,8 @@ options: description: - The authentication type to use for the user. choices: ["password", "radius", "otp", "pkinit", "hardened"] - type: str + type: list + elements: str version_added: '1.2.0' extends_documentation_fragment: - community.general.ipa.documentation @@ -146,11 +147,13 @@ EXAMPLES = r''' ipa_pass: topsecret update_password: on_create -- name: Ensure pinky is present and using one time password authentication +- name: Ensure pinky is present and using one time password and RADIUS authentication community.general.ipa_user: name: pinky state: present - userauthtype: otp + userauthtype: + - otp + - radius ipa_host: ipa.example.com ipa_user: admin ipa_pass: topsecret @@ -363,7 +366,7 @@ def main(): telephonenumber=dict(type='list', elements='str'), title=dict(type='str'), homedirectory=dict(type='str'), - userauthtype=dict(type='str', + userauthtype=dict(type='list', elements='str', choices=['password', 'radius', 'otp', 'pkinit', 'hardened'])) module = AnsibleModule(argument_spec=argument_spec,