diff --git a/changelogs/fragments/2268-validation-univetion.yml b/changelogs/fragments/2268-validation-univetion.yml new file mode 100644 index 0000000000..f245380441 --- /dev/null +++ b/changelogs/fragments/2268-validation-univetion.yml @@ -0,0 +1,4 @@ +bugfixes: + - udm_dns_record - fixed default value of parameter ``data`` to match its type (https://github.com/ansible-collections/community.general/pull/2268). +minor_changes: + - udm_dns_zone - elements of list parameters ``nameserver``, ``interfaces``, and ``mx`` are now validated (https://github.com/ansible-collections/community.general/pull/2268). diff --git a/plugins/modules/cloud/univention/udm_dns_record.py b/plugins/modules/cloud/univention/udm_dns_record.py index db89bd46b6..90654bee3c 100644 --- a/plugins/modules/cloud/univention/udm_dns_record.py +++ b/plugins/modules/cloud/univention/udm_dns_record.py @@ -23,21 +23,24 @@ requirements: - Univention options: state: - required: false + type: str default: "present" choices: [ present, absent ] description: - Whether the dns record is present or not. name: + type: str required: true description: - "Name of the record, this is also the DNS record. E.g. www for www.example.com." zone: + type: str required: true description: - Corresponding DNS zone for this record, e.g. example.com. type: + type: str required: true description: - "Define the record type. C(host_record) is a A or AAAA record, @@ -45,8 +48,8 @@ options: is a SRV record and C(txt_record) is a TXT record." - "The available choices are: C(host_record), C(alias), C(ptr_record), C(srv_record), C(txt_record)." data: - required: false - default: [] + type: dict + default: {} description: - "Additional data for this record, e.g. ['a': '192.0.2.1']. Required if C(state=present)." @@ -98,7 +101,7 @@ def main(): type='str'), name=dict(required=True, type='str'), - data=dict(default=[], + data=dict(default={}, type='dict'), state=dict(default='present', choices=['present', 'absent'], diff --git a/plugins/modules/cloud/univention/udm_dns_zone.py b/plugins/modules/cloud/univention/udm_dns_zone.py index 2428650e90..3e0cae523d 100644 --- a/plugins/modules/cloud/univention/udm_dns_zone.py +++ b/plugins/modules/cloud/univention/udm_dns_zone.py @@ -22,58 +22,64 @@ requirements: - Python >= 2.6 options: state: - required: false + type: str default: "present" choices: [ present, absent ] description: - Whether the dns zone is present or not. type: + type: str required: true description: - Define if the zone is a forward or reverse DNS zone. - "The available choices are: C(forward_zone), C(reverse_zone)." zone: + type: str required: true description: - DNS zone name, e.g. C(example.com). + aliases: [name] nameserver: - required: false + type: list + elements: str description: - List of appropriate name servers. Required if C(state=present). interfaces: - required: false + type: list + elements: str description: - List of interface IP addresses, on which the server should response this zone. Required if C(state=present). refresh: - required: false + type: int default: 3600 description: - Interval before the zone should be refreshed. retry: - required: false + type: int default: 1800 description: - Interval that should elapse before a failed refresh should be retried. expire: - required: false + type: int default: 604800 description: - Specifies the upper limit on the time interval that can elapse before the zone is no longer authoritative. ttl: - required: false + type: int default: 600 description: - Minimum TTL field that should be exported with any RR from this zone. contact: - required: false + type: str default: '' description: - Contact person in the SOA record. mx: - required: false + type: list + elements: str default: [] description: - List of MX servers. (Must declared as A or AAAA records). @@ -128,9 +134,11 @@ def main(): aliases=['name'], type='str'), nameserver=dict(default=[], - type='list'), + type='list', + elements='str'), interfaces=dict(default=[], - type='list'), + type='list', + elements='str'), refresh=dict(default=3600, type='int'), retry=dict(default=1800, @@ -142,7 +150,8 @@ def main(): contact=dict(default='', type='str'), mx=dict(default=[], - type='list'), + type='list', + elements='str'), state=dict(default='present', choices=['present', 'absent'], type='str') diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 2ef37bd2c4..7beedfa206 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -28,10 +28,6 @@ plugins/modules/cloud/smartos/vmadm.py validate-modules:undocumented-parameter plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter -plugins/modules/cloud/univention/udm_dns_record.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/univention/udm_dns_zone.py validate-modules:parameter-list-no-elements -plugins/modules/cloud/univention/udm_dns_zone.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/univention/udm_dns_zone.py validate-modules:undocumented-parameter plugins/modules/cloud/univention/udm_share.py validate-modules:parameter-list-no-elements plugins/modules/cloud/univention/udm_user.py validate-modules:parameter-list-no-elements plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index 60387b1333..80975cf389 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -27,10 +27,6 @@ plugins/modules/cloud/smartos/vmadm.py validate-modules:undocumented-parameter plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter -plugins/modules/cloud/univention/udm_dns_record.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/univention/udm_dns_zone.py validate-modules:parameter-list-no-elements -plugins/modules/cloud/univention/udm_dns_zone.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/univention/udm_dns_zone.py validate-modules:undocumented-parameter plugins/modules/cloud/univention/udm_share.py validate-modules:parameter-list-no-elements plugins/modules/cloud/univention/udm_user.py validate-modules:parameter-list-no-elements plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 60387b1333..80975cf389 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -27,10 +27,6 @@ plugins/modules/cloud/smartos/vmadm.py validate-modules:undocumented-parameter plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter -plugins/modules/cloud/univention/udm_dns_record.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/univention/udm_dns_zone.py validate-modules:parameter-list-no-elements -plugins/modules/cloud/univention/udm_dns_zone.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/univention/udm_dns_zone.py validate-modules:undocumented-parameter plugins/modules/cloud/univention/udm_share.py validate-modules:parameter-list-no-elements plugins/modules/cloud/univention/udm_user.py validate-modules:parameter-list-no-elements plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index a8ab8c457c..36a0c3e08e 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -23,9 +23,6 @@ plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-do plugins/modules/cloud/smartos/vmadm.py validate-modules:undocumented-parameter plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter -plugins/modules/cloud/univention/udm_dns_record.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/univention/udm_dns_zone.py validate-modules:parameter-type-not-in-doc -plugins/modules/cloud/univention/udm_dns_zone.py validate-modules:undocumented-parameter plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter plugins/modules/packaging/language/composer.py validate-modules:parameter-invalid