1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

dig lookup: deprecate DLV record type (#4618)

* Deprecate DLV record type.

* Use correct name.
This commit is contained in:
Felix Fontein 2022-05-05 08:18:04 +02:00 committed by GitHub
parent 9462506edc
commit b711038b3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 3 deletions

View file

@ -0,0 +1,2 @@
deprecated_features:
- "dig lookup plugin - the ``DLV`` record type has been decommissioned in 2017 and support for it will be removed from community.general 6.0.0 (https://github.com/ansible-collections/community.general/pull/4618)."

View file

@ -27,13 +27,15 @@ DOCUMENTATION = '''
This needs to be passed-in as an additional parameter to the lookup
options:
_terms:
description: domain(s) to query
description: Domain(s) to query.
qtype:
description: record type to query
description:
- Record type to query.
- C(DLV) is deprecated and will be removed in community.general 6.0.0.
default: 'A'
choices: [A, ALL, AAAA, CNAME, DNAME, DLV, DNSKEY, DS, HINFO, LOC, MX, NAPTR, NS, NSEC3PARAM, PTR, RP, RRSIG, SOA, SPF, SRV, SSHFP, TLSA, TXT]
flat:
description: If 0 each record is returned as a dictionary, otherwise a string
description: If 0 each record is returned as a dictionary, otherwise a string.
default: 1
retry_servfail:
description: Retry a nameserver if it returns SERVFAIL.
@ -163,6 +165,7 @@ RETURN = """
from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase
from ansible.module_utils.common.text.converters import to_native
from ansible.utils.display import Display
import socket
try:
@ -178,6 +181,9 @@ except ImportError:
HAVE_DNS = False
display = Display()
def make_rdata_dict(rdata):
''' While the 'dig' lookup plugin supports anything which dnspython supports
out of the box, the following supported_types list describes which
@ -326,6 +332,11 @@ class LookupModule(LookupBase):
ret = []
if qtype.upper() == 'DLV':
display.deprecated('The DLV record type has been decommissioned in 2017 and support for'
' it will be removed from community.general 6.0.0',
version='6.0.0', collection_name='community.general')
if qtype.upper() == 'PTR':
try:
n = dns.reversename.from_address(domain)