ipaautomountkey: Fix documentation sections and agument spec

ansible-test with ansible-2.14 is adding a lot of new tests to ensure
that the documentation section and the agument spec is complete. Needed
changes:

DOCUMENTATION section
- `type: str` needs to be set for string parameters
- `required` tags need to be fixed according to the `argument_spec`
- `aliases` tag need to be consistent to `argument_spec`
- `authors` needs to be given with the github user also: `Name (@user)`
- `extends_documentation_fragment: ipamodule_base_docs` needs added and
  `ipaadmin_*` parameters need to be removed
- `choices` needs to be replaced with `aliases` to match `argument_spec`

argument_spec
- `no_log=False` or `no_log=True` needs to be set for all parameters
  that have `key` in the name or for dicts also in one the key names
- `required=None` needs to be replaced by `required=False`

The `copyright` date is extended with `-2022`.
This commit is contained in:
Thomas Woerner
2022-09-30 13:48:44 +02:00
parent 07c8bb1efb
commit 489eb5780f

View File

@@ -3,8 +3,9 @@
# Authors:
# Chris Procter <cprocter@redhat.com>
# Thomas Woerner <twoerner@redhat.com>
#
# Copyright (C) 2021 Red Hat
# Copyright (C) 2021-2022 Red Hat
# see file 'COPYING' for use and warranty information
#
# This program is free software; you can redistribute it and/or modify
@@ -34,39 +35,43 @@ ANSIBLE_METADATA = {
DOCUMENTATION = '''
---
module: ipaautomountkey
author: chris procter
author:
- Chris Procter (@chr15p))
- Thomas Woerner (@t-woerner)
short_description: Manage FreeIPA autommount map
description:
- Add, delete, and modify an IPA automount map
extends_documentation_fragment:
- ipamodule_base_docs
options:
ipaadmin_principal:
description: The admin principal
default: admin
ipaadmin_password:
description: The admin password
required: False
location:
description: automount location map is in
type: str
required: True
choices: ["automountlocationcn", "automountlocation"]
aliases: ["automountlocationcn", "automountlocation"]
mapname:
description: automount map to be managed
choices: ["map", "automountmapname", "automountmap"]
type: str
aliases: ["map", "automountmapname", "automountmap"]
required: True
key:
description: automount key to be managed
type: str
required: True
choices: ["name", "automountkey"]
newkey:
aliases: ["name", "automountkey"]
rename:
description: key to change to if state is 'renamed'
required: True
choices: ["newname", "newautomountkey"]
type: str
required: False
aliases: ["new_name", "newautomountkey"]
info:
description: Mount information for the key
required: True
choices: ["information", "automountinformation"]
type: str
required: False
aliases: ["information", "automountinformation"]
state:
description: State to ensure
type: str
required: False
default: present
choices: ["present", "absent", "renamed"]
@@ -193,7 +198,7 @@ def main():
state=dict(
type='str',
choices=['present', 'absent', 'renamed'],
required=None,
required=False,
default='present',
),
location=dict(
@@ -215,6 +220,7 @@ def main():
type="str",
aliases=["name", "automountkey"],
required=True,
no_log=False,
),
info=dict(
type="str",