Skip to content
Snippets Groups Projects
Commit c8ca3164 authored by Thomas Woerner's avatar Thomas Woerner
Browse files

ipahbacrule: 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
- `type: list` needs to be set for list parameters
- `elements: str` needs to be given for list of string parameters
- `authors` needs to be given with the github user also: `Name (@user)`

argument_spec

- `elements="str"` needs to be added to all list of string parameters

The `copyright` date is extended with `-2022`.
parent 07c8bb1e
Branches
Tags
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Authors: # Authors:
# Thomas Woerner <twoerner@redhat.com> # Thomas Woerner <twoerner@redhat.com>
# #
# Copyright (C) 2019 Red Hat # Copyright (C) 2019-2022 Red Hat
# see file 'COPYING' for use and warranty information # see file 'COPYING' for use and warranty information
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
...@@ -39,23 +39,29 @@ extends_documentation_fragment: ...@@ -39,23 +39,29 @@ extends_documentation_fragment:
options: options:
name: name:
description: The hbacrule name description: The hbacrule name
type: list
elements: str
required: true required: true
aliases: ["cn"] aliases: ["cn"]
description: description:
description: The hbacrule description description: The hbacrule description
type: str
required: false required: false
usercategory: usercategory:
description: User category the rule applies to description: User category the rule applies to
type: str
required: false required: false
aliases: ["usercat"] aliases: ["usercat"]
choices: ["all", ""] choices: ["all", ""]
hostcategory: hostcategory:
description: Host category the rule applies to description: Host category the rule applies to
type: str
required: false required: false
aliases: ["hostcat"] aliases: ["hostcat"]
choices: ["all", ""] choices: ["all", ""]
servicecategory: servicecategory:
description: Service category the rule applies to description: Service category the rule applies to
type: str
required: false required: false
aliases: ["servicecat"] aliases: ["servicecat"]
choices: ["all", ""] choices: ["all", ""]
...@@ -67,36 +73,44 @@ options: ...@@ -67,36 +73,44 @@ options:
description: List of host names assigned to this hbacrule. description: List of host names assigned to this hbacrule.
required: false required: false
type: list type: list
elements: str
hostgroup: hostgroup:
description: List of host groups assigned to this hbacrule. description: List of host groups assigned to this hbacrule.
required: false required: false
type: list type: list
elements: str
hbacsvc: hbacsvc:
description: List of HBAC service names assigned to this hbacrule. description: List of HBAC service names assigned to this hbacrule.
required: false required: false
type: list type: list
elements: str
hbacsvcgroup: hbacsvcgroup:
description: List of HBAC service names assigned to this hbacrule. description: List of HBAC service names assigned to this hbacrule.
required: false required: false
type: list type: list
elements: str
user: user:
description: List of user names assigned to this hbacrule. description: List of user names assigned to this hbacrule.
required: false required: false
type: list type: list
elements: str
group: group:
description: List of user groups assigned to this hbacrule. description: List of user groups assigned to this hbacrule.
required: false required: false
type: list type: list
elements: str
action: action:
description: Work on hbacrule or member level description: Work on hbacrule or member level
type: str
default: hbacrule default: hbacrule
choices: ["member", "hbacrule"] choices: ["member", "hbacrule"]
state: state:
description: State to ensure description: State to ensure
type: str
default: present default: present
choices: ["present", "absent", "enabled", "disabled"] choices: ["present", "absent", "enabled", "disabled"]
author: author:
- Thomas Woerner - Thomas Woerner (@t-woerner)
""" """
EXAMPLES = """ EXAMPLES = """
...@@ -198,7 +212,7 @@ def main(): ...@@ -198,7 +212,7 @@ def main():
ansible_module = IPAAnsibleModule( ansible_module = IPAAnsibleModule(
argument_spec=dict( argument_spec=dict(
# general # general
name=dict(type="list", aliases=["cn"], default=None, name=dict(type="list", elements="str", aliases=["cn"],
required=True), required=True),
# present # present
description=dict(type="str", default=None), description=dict(type="str", default=None),
...@@ -209,12 +223,18 @@ def main(): ...@@ -209,12 +223,18 @@ def main():
servicecategory=dict(type="str", default=None, servicecategory=dict(type="str", default=None,
aliases=["servicecat"], choices=["all", ""]), aliases=["servicecat"], choices=["all", ""]),
nomembers=dict(required=False, type='bool', default=None), nomembers=dict(required=False, type='bool', default=None),
host=dict(required=False, type='list', default=None), host=dict(required=False, type='list', elements="str",
hostgroup=dict(required=False, type='list', default=None), default=None),
hbacsvc=dict(required=False, type='list', default=None), hostgroup=dict(required=False, type='list', elements="str",
hbacsvcgroup=dict(required=False, type='list', default=None), default=None),
user=dict(required=False, type='list', default=None), hbacsvc=dict(required=False, type='list', elements="str",
group=dict(required=False, type='list', default=None), default=None),
hbacsvcgroup=dict(required=False, type='list', elements="str",
default=None),
user=dict(required=False, type='list', elements="str",
default=None),
group=dict(required=False, type='list', elements="str",
default=None),
action=dict(type="str", default="hbacrule", action=dict(type="str", default="hbacrule",
choices=["member", "hbacrule"]), choices=["member", "hbacrule"]),
# state # state
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment