1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add ipaselinuxusermaporder option to the ipa_config module (#3178)

This commit is contained in:
Roy Lenferink 2021-09-12 13:46:17 +02:00 committed by GitHub
parent 58d018ebbd
commit 612543919e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 2 deletions

View file

@ -0,0 +1,3 @@
minor_changes:
- ipa_config - add ``ipaselinuxusermaporder`` option to set the SELinux user map order
(https://github.com/ansible-collections/community.general/pull/3178).

View file

@ -72,6 +72,12 @@ options:
aliases: ["searchtimelimit"] aliases: ["searchtimelimit"]
type: int type: int
version_added: '2.5.0' version_added: '2.5.0'
ipaselinuxusermaporder:
description: The SELinux user map order (order in increasing priority of SELinux users).
aliases: ["selinuxusermaporder"]
type: list
elements: str
version_added: '3.7.0'
ipauserauthtype: ipauserauthtype:
description: The authentication type to use by default. description: The authentication type to use by default.
aliases: ["userauthtype"] aliases: ["userauthtype"]
@ -181,6 +187,18 @@ EXAMPLES = r'''
ipa_host: localhost ipa_host: localhost
ipa_user: admin ipa_user: admin
ipa_pass: supersecret ipa_pass: supersecret
- name: Ensure the SELinux user map order is set
community.general.ipa_config:
ipaselinuxusermaporder:
- "guest_u:s0"
- "xguest_u:s0"
- "user_u:s0"
- "staff_u:s0-s0:c0.c1023"
- "unconfined_u:s0-s0:c0.c1023"
ipa_host: localhost
ipa_user: admin
ipa_pass: supersecret
''' '''
RETURN = r''' RETURN = r'''
@ -213,8 +231,8 @@ def get_config_dict(ipaconfigstring=None, ipadefaultloginshell=None,
ipagroupsearchfields=None, ipahomesrootdir=None, ipagroupsearchfields=None, ipahomesrootdir=None,
ipakrbauthzdata=None, ipamaxusernamelength=None, ipakrbauthzdata=None, ipamaxusernamelength=None,
ipapwdexpadvnotify=None, ipasearchrecordslimit=None, ipapwdexpadvnotify=None, ipasearchrecordslimit=None,
ipasearchtimelimit=None, ipauserauthtype=None, ipasearchtimelimit=None, ipaselinuxusermaporder=None,
ipausersearchfields=None): ipauserauthtype=None, ipausersearchfields=None):
config = {} config = {}
if ipaconfigstring is not None: if ipaconfigstring is not None:
config['ipaconfigstring'] = ipaconfigstring config['ipaconfigstring'] = ipaconfigstring
@ -238,6 +256,8 @@ def get_config_dict(ipaconfigstring=None, ipadefaultloginshell=None,
config['ipasearchrecordslimit'] = str(ipasearchrecordslimit) config['ipasearchrecordslimit'] = str(ipasearchrecordslimit)
if ipasearchtimelimit is not None: if ipasearchtimelimit is not None:
config['ipasearchtimelimit'] = str(ipasearchtimelimit) config['ipasearchtimelimit'] = str(ipasearchtimelimit)
if ipaselinuxusermaporder is not None:
config['ipaselinuxusermaporder'] = '$'.join(ipaselinuxusermaporder)
if ipauserauthtype is not None: if ipauserauthtype is not None:
config['ipauserauthtype'] = ipauserauthtype config['ipauserauthtype'] = ipauserauthtype
if ipausersearchfields is not None: if ipausersearchfields is not None:
@ -263,6 +283,7 @@ def ensure(module, client):
ipapwdexpadvnotify=module.params.get('ipapwdexpadvnotify'), ipapwdexpadvnotify=module.params.get('ipapwdexpadvnotify'),
ipasearchrecordslimit=module.params.get('ipasearchrecordslimit'), ipasearchrecordslimit=module.params.get('ipasearchrecordslimit'),
ipasearchtimelimit=module.params.get('ipasearchtimelimit'), ipasearchtimelimit=module.params.get('ipasearchtimelimit'),
ipaselinuxusermaporder=module.params.get('ipaselinuxusermaporder'),
ipauserauthtype=module.params.get('ipauserauthtype'), ipauserauthtype=module.params.get('ipauserauthtype'),
ipausersearchfields=module.params.get('ipausersearchfields'), ipausersearchfields=module.params.get('ipausersearchfields'),
) )
@ -304,6 +325,8 @@ def main():
ipapwdexpadvnotify=dict(type='int', aliases=['pwdexpadvnotify']), ipapwdexpadvnotify=dict(type='int', aliases=['pwdexpadvnotify']),
ipasearchrecordslimit=dict(type='int', aliases=['searchrecordslimit']), ipasearchrecordslimit=dict(type='int', aliases=['searchrecordslimit']),
ipasearchtimelimit=dict(type='int', aliases=['searchtimelimit']), ipasearchtimelimit=dict(type='int', aliases=['searchtimelimit']),
ipaselinuxusermaporder=dict(type='list', elements='str',
aliases=['selinuxusermaporder']),
ipauserauthtype=dict(type='list', elements='str', ipauserauthtype=dict(type='list', elements='str',
aliases=['userauthtype'], aliases=['userauthtype'],
choices=["password", "radius", "otp", "pkinit", choices=["password", "radius", "otp", "pkinit",