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

ipadnsforwardzone: : 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

- `module` tag needs to be correct
- `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
- `suboptions` instead of `options` needs to be used for dict parameters
- `aliases` tag needs to match `argument_spec`
- `default` tag needs to match `argument_spec`
- `authors` needs to be given with the github user also: `Name (@user)`
- `action` parameter is missing and added

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
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
# Authors: # Authors:
# Chris Procter <cprocter@redhat.com> # Chris Procter <cprocter@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
...@@ -32,8 +33,10 @@ ANSIBLE_METADATA = { ...@@ -32,8 +33,10 @@ ANSIBLE_METADATA = {
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: ipa_dnsforwardzone module: ipadnsforwardzone
author: chris procter author:
- Chris Procter (@chr15p)
- Thomas Woerner (@t-woerner)
short_description: Manage FreeIPA DNS Forwarder Zones short_description: Manage FreeIPA DNS Forwarder Zones
description: description:
- Add and delete an IPA DNS Forwarder Zones using IPA API - Add and delete an IPA DNS Forwarder Zones using IPA API
...@@ -43,42 +46,55 @@ options: ...@@ -43,42 +46,55 @@ options:
name: name:
description: description:
- The DNS zone name which needs to be managed. - The DNS zone name which needs to be managed.
type: list
elements: str
required: true required: true
aliases: ["cn"] aliases: ["cn"]
action:
description: |
Work on dnsforwardzone or member level. It can be one of `member` or
`dnsforwardzone`.
type: str
default: "dnsforwardzone"
choices: ["member", "dnsforwardzone"]
state: state:
description: State to ensure description: State to ensure
type: str
required: false required: false
default: present default: present
choices: ["present", "absent", "enabled", "disabled"] choices: ["present", "absent", "enabled", "disabled"]
forwarders: forwarders:
description: description:
- List of the DNS servers to forward to - List of the DNS servers to forward to
type: list
elements: dict
aliases: ["idnsforwarders"] aliases: ["idnsforwarders"]
options: suboptions:
ip_address: ip_address:
description: Forwarder IP address (either IPv4 or IPv6). description: Forwarder IP address (either IPv4 or IPv6).
required: false required: true
type: string type: str
port: port:
description: Forwarder port. description: Forwarder port.
required: false required: false
type: int type: int
forwardpolicy: forwardpolicy:
description: Per-zone conditional forwarding policy description: Per-zone conditional forwarding policy
type: str
required: false required: false
default: only
choices: ["only", "first", "none"] choices: ["only", "first", "none"]
aliases: ["idnsforwarders", "forward_policy"] aliases: ["idnsforwardpolicy", "forward_policy"]
skip_overlap_check: skip_overlap_check:
description: description:
- Force DNS zone creation even if it will overlap with an existing zone. - Force DNS zone creation even if it will overlap with an existing zone.
type: bool
required: false required: false
default: false
permission: permission:
description: description:
- Allow DNS Forward Zone to be managed. - Allow DNS Forward Zone to be managed.
required: false required: false
type: bool type: bool
aliases: ["managedby"]
''' '''
EXAMPLES = ''' EXAMPLES = '''
...@@ -180,7 +196,7 @@ def main(): ...@@ -180,7 +196,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),
forwarders=dict(type="list", default=None, required=False, forwarders=dict(type="list", default=None, required=False,
aliases=["idnsforwarders"], elements='dict', aliases=["idnsforwarders"], elements='dict',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment