diff --git a/changelogs/fragments/4618-dig-dlv.yml b/changelogs/fragments/4618-dig-dlv.yml new file mode 100644 index 0000000000..bc082d4093 --- /dev/null +++ b/changelogs/fragments/4618-dig-dlv.yml @@ -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)." diff --git a/plugins/lookup/dig.py b/plugins/lookup/dig.py index 19ded61de7..291bac5e45 100644 --- a/plugins/lookup/dig.py +++ b/plugins/lookup/dig.py @@ -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)