Skip to content

Commit

Permalink
udm_user: sanity (ansible-collections#5559)
Browse files Browse the repository at this point in the history
* fix parameter email

* fix parameter groups

* fix parameters home_telephone_number, mail_alternative_address, mobile_telephone_number, pager_telephonenumber

* fix parameter phone

* fix parameter samba_privileges

* fix parameter samba_user_workstations

* fix parameter secretary

* fix parameter serviceprovider

* remove lines from ignore files

* add changelog fragment
  • Loading branch information
russoz committed Nov 27, 2022
1 parent 5c7ff01 commit a02beb8
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 10 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/5559-udm-user-sanity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- udm_user - add ``elements`` attribute when missing in ``list`` parameters (https://github.com/ansible-collections/community.general/pull/5559).
32 changes: 27 additions & 5 deletions plugins/modules/udm_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
description:
- A list of e-mail addresses.
type: list
elements: str
employee_number:
description:
- Employee number
Expand All @@ -99,6 +100,7 @@
LDAP filter for each group as $GROUP:
C((&(objectClass=posixGroup)(cn=$GROUP)))."
type: list
elements: str
home_share:
description:
- "Home NFS share. Must be a LDAP DN, e.g.
Expand All @@ -116,6 +118,7 @@
- List of private telephone numbers.
aliases: [ homeTelephoneNumber ]
type: list
elements: str
homedrive:
description:
- Windows home drive, e.g. C("H:").
Expand All @@ -126,6 +129,7 @@
- List of alternative e-mail addresses.
aliases: [ mailAlternativeAddress ]
type: list
elements: str
mail_home_server:
description:
- FQDN of mail server
Expand All @@ -142,6 +146,7 @@
- Mobile phone number
aliases: [ mobileTelephoneNumber ]
type: list
elements: str
organisation:
description:
- Organisation
Expand All @@ -165,10 +170,12 @@
- List of pager telephone numbers.
aliases: [ pagerTelephonenumber ]
type: list
elements: str
phone:
description:
- List of telephone numbers.
type: list
elements: str
default: []
postcode:
description:
Expand Down Expand Up @@ -201,12 +208,14 @@
join."
aliases: [ sambaPrivileges ]
type: list
elements: str
default: []
samba_user_workstations:
description:
- Allow the authentication only on this Microsoft Windows host.
aliases: [ sambaUserWorkstations ]
type: list
elements: str
default: []
sambahome:
description:
Expand All @@ -221,11 +230,13 @@
description:
- A list of superiors as LDAP DNs.
type: list
elements: str
serviceprovider:
default: ['']
description:
- Enable user for the following service providers.
type: list
elements: str
shell:
default: '/bin/bash'
description:
Expand Down Expand Up @@ -333,33 +344,38 @@ def main():
display_name=dict(type='str',
aliases=['displayName']),
email=dict(default=[''],
type='list'),
type='list',
elements='str'),
employee_number=dict(type='str',
aliases=['employeeNumber']),
employee_type=dict(type='str',
aliases=['employeeType']),
firstname=dict(type='str'),
gecos=dict(type='str'),
groups=dict(default=[],
type='list'),
type='list',
elements='str'),
home_share=dict(type='str',
aliases=['homeShare']),
home_share_path=dict(type='str',
aliases=['homeSharePath']),
home_telephone_number=dict(default=[],
type='list',
elements='str',
aliases=['homeTelephoneNumber']),
homedrive=dict(type='str'),
lastname=dict(type='str'),
mail_alternative_address=dict(default=[],
type='list',
elements='str',
aliases=['mailAlternativeAddress']),
mail_home_server=dict(type='str',
aliases=['mailHomeServer']),
mail_primary_address=dict(type='str',
aliases=['mailPrimaryAddress']),
mobile_telephone_number=dict(default=[],
type='list',
elements='str',
aliases=['mobileTelephoneNumber']),
organisation=dict(type='str',
aliases=['organization']),
Expand All @@ -371,11 +387,13 @@ def main():
aliases=['override_pw_length']),
pager_telephonenumber=dict(default=[],
type='list',
elements='str',
aliases=['pagerTelephonenumber']),
password=dict(type='str',
no_log=True),
phone=dict(default=[],
type='list'),
type='list',
elements='str'),
postcode=dict(type='str'),
primary_group=dict(type='str',
aliases=['primaryGroup']),
Expand All @@ -387,16 +405,20 @@ def main():
aliases=['roomNumber']),
samba_privileges=dict(default=[],
type='list',
elements='str',
aliases=['sambaPrivileges']),
samba_user_workstations=dict(default=[],
type='list',
elements='str',
aliases=['sambaUserWorkstations']),
sambahome=dict(type='str'),
scriptpath=dict(type='str'),
secretary=dict(default=[],
type='list'),
type='list',
elements='str'),
serviceprovider=dict(default=[''],
type='list'),
type='list',
elements='str'),
shell=dict(default='/bin/bash',
type='str'),
street=dict(type='str'),
Expand Down
1 change: 0 additions & 1 deletion tests/sanity/ignore-2.11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ plugins/modules/rax.py use-argspec-type-path # fix needed
plugins/modules/rhevm.py validate-modules:parameter-state-invalid-choice
plugins/modules/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path
plugins/modules/udm_share.py validate-modules:parameter-list-no-elements
plugins/modules/udm_user.py validate-modules:parameter-list-no-elements
plugins/modules/xfconf.py validate-modules:return-syntax-error
plugins/modules/yarn.py use-argspec-type-path
tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py compile-2.6 # django generated code
Expand Down
1 change: 0 additions & 1 deletion tests/sanity/ignore-2.12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ plugins/modules/rax.py use-argspec-type-path # fix needed
plugins/modules/rhevm.py validate-modules:parameter-state-invalid-choice
plugins/modules/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path
plugins/modules/udm_share.py validate-modules:parameter-list-no-elements
plugins/modules/udm_user.py validate-modules:parameter-list-no-elements
plugins/modules/xfconf.py validate-modules:return-syntax-error
plugins/modules/yarn.py use-argspec-type-path
1 change: 0 additions & 1 deletion tests/sanity/ignore-2.13.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ plugins/modules/rax.py use-argspec-type-path # fix needed
plugins/modules/rhevm.py validate-modules:parameter-state-invalid-choice
plugins/modules/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path
plugins/modules/udm_share.py validate-modules:parameter-list-no-elements
plugins/modules/udm_user.py validate-modules:parameter-list-no-elements
plugins/modules/xfconf.py validate-modules:return-syntax-error
plugins/modules/yarn.py use-argspec-type-path
1 change: 0 additions & 1 deletion tests/sanity/ignore-2.14.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@ plugins/modules/rhevm.py validate-modules:parameter-state-invalid-choice
plugins/modules/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path
plugins/modules/udm_share.py validate-modules:parameter-list-no-elements
plugins/modules/udm_user.py import-3.11 # Uses deprecated stdlib library 'crypt'
plugins/modules/udm_user.py validate-modules:parameter-list-no-elements
plugins/modules/xfconf.py validate-modules:return-syntax-error
plugins/modules/yarn.py use-argspec-type-path
1 change: 0 additions & 1 deletion tests/sanity/ignore-2.15.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@ plugins/modules/rhevm.py validate-modules:parameter-state-invalid-choice
plugins/modules/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path
plugins/modules/udm_share.py validate-modules:parameter-list-no-elements
plugins/modules/udm_user.py import-3.11 # Uses deprecated stdlib library 'crypt'
plugins/modules/udm_user.py validate-modules:parameter-list-no-elements
plugins/modules/xfconf.py validate-modules:return-syntax-error
plugins/modules/yarn.py use-argspec-type-path

0 comments on commit a02beb8

Please sign in to comment.