diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-26 04:06:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-26 04:06:02 +0000 |
commit | e3eb94c23206603103f3c4faec6c227f59a1544c (patch) | |
tree | f2639459807ba88f55fc9c54d745bd7075d7f15c /ansible_collections/community/dns/plugins | |
parent | Releasing progress-linux version 9.4.0+dfsg-1~progress7.99u1. (diff) | |
download | ansible-e3eb94c23206603103f3c4faec6c227f59a1544c.tar.xz ansible-e3eb94c23206603103f3c4faec6c227f59a1544c.zip |
Merging upstream version 9.5.1+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/community/dns/plugins')
6 files changed, 324 insertions, 66 deletions
diff --git a/ansible_collections/community/dns/plugins/filter/quote_txt.yml b/ansible_collections/community/dns/plugins/filter/quote_txt.yml new file mode 100644 index 000000000..c42274718 --- /dev/null +++ b/ansible_collections/community/dns/plugins/filter/quote_txt.yml @@ -0,0 +1,46 @@ +--- +# Copyright (c) Ansible Project +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later + +DOCUMENTATION: + name: quote_txt + short_description: Quotes a string to use as a TXT record entry + version_added: 2.9.0 + description: + - Given a string, quotes it so it can be used in a TXT record entry. + options: + _input: + description: + - The string to quote. + type: string + required: true + always_quote: + description: + - Whether to always quote the resulting string in double quotes. + type: bool + default: false + character_encoding: + description: + - Whether to treat numeric escape sequences (V(\\xyz)) as octal or decimal numbers. + - The default value V(decimal) is compatible to L(RFC 1035, https://www.ietf.org/rfc/rfc1035.txt). + type: str + default: decimal + choices: + - decimal + - octal + author: + - Felix Fontein (@felixfontein) + +EXAMPLES: | + - name: Quote a TXT entry + ansible.builtin.set_fact: + public_suffix: "{{ value | community.dns.quote_txt }}" + # Should result in '"this is a test"' + vars: + value: this is a test + +RETURN: + _value: + description: The quoted string that can be used for a TXT entry. + type: string diff --git a/ansible_collections/community/dns/plugins/filter/txt.py b/ansible_collections/community/dns/plugins/filter/txt.py new file mode 100644 index 000000000..4f2d3a16f --- /dev/null +++ b/ansible_collections/community/dns/plugins/filter/txt.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2020-2021, Felix Fontein <felix@fontein.de> +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later + +from __future__ import absolute_import, division, print_function +__metaclass__ = type + +from ansible.errors import AnsibleFilterError +from ansible.module_utils.common.text.converters import to_text +from ansible.module_utils.six import string_types + +from ansible_collections.community.dns.plugins.module_utils.conversion.txt import ( + decode_txt_value, + encode_txt_value, +) + + +def quote_txt(value, always_quote=False, character_encoding='decimal'): + if not isinstance(value, string_types): + raise AnsibleFilterError('Input for community.dns.quote_txt must be a string') + if not isinstance(always_quote, bool): + raise AnsibleFilterError('always_quote must be a boolean, not {value!r}'.format(value=always_quote)) + if character_encoding not in ('decimal', 'octal'): + raise AnsibleFilterError('character_encoding must be "decimal" or "octal", not {value!r}'.format(value=character_encoding)) + value = to_text(value) + return encode_txt_value(value, always_quote=always_quote, character_encoding=character_encoding) + + +def unquote_txt(value, character_encoding='decimal'): + if not isinstance(value, string_types): + raise AnsibleFilterError('Input for community.dns.unquote_txt must be a string') + if character_encoding not in ('decimal', 'octal'): + raise AnsibleFilterError('character_encoding must be "decimal" or "octal", not {value!r}'.format(value=character_encoding)) + value = to_text(value) + return decode_txt_value(value, character_encoding=character_encoding) + + +class FilterModule(object): + '''Ansible jinja2 filters''' + + def filters(self): + return { + 'quote_txt': quote_txt, + 'unquote_txt': unquote_txt, + } diff --git a/ansible_collections/community/dns/plugins/filter/unquote_txt.yml b/ansible_collections/community/dns/plugins/filter/unquote_txt.yml new file mode 100644 index 000000000..712cf3ad4 --- /dev/null +++ b/ansible_collections/community/dns/plugins/filter/unquote_txt.yml @@ -0,0 +1,42 @@ +--- +# Copyright (c) Ansible Project +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later + +DOCUMENTATION: + name: unquote_txt + short_description: Unquotes a TXT record entry to a string + version_added: 2.9.0 + description: + - Given a (quoted) TXT entry content, extracts its value. + options: + _input: + description: + - The string to unquote. + type: string + required: true + character_encoding: + description: + - Whether to treat numeric escape sequences (V(\\xyz)) as octal or decimal numbers. + - The default value V(decimal) is compatible to L(RFC 1035, https://www.ietf.org/rfc/rfc1035.txt). + type: str + default: decimal + choices: + - decimal + - octal + author: + - Felix Fontein (@felixfontein) + +EXAMPLES: | + - name: Unquote a TXT entry + ansible.builtin.set_fact: + public_suffix: "{{ value | community.dns.unquote_txt }}" + # Should result in 'this is a test' + vars: + value: >- + "this is " "a test" + +RETURN: + _value: + description: The extracted string. + type: string diff --git a/ansible_collections/community/dns/plugins/plugin_utils/inventory/records.py b/ansible_collections/community/dns/plugins/plugin_utils/inventory/records.py index 30fa11bdc..1d6827f2f 100644 --- a/ansible_collections/community/dns/plugins/plugin_utils/inventory/records.py +++ b/ansible_collections/community/dns/plugins/plugin_utils/inventory/records.py @@ -15,7 +15,6 @@ from ansible.module_utils import six from ansible.module_utils.common._collections_compat import Sequence from ansible.plugins.inventory import BaseInventoryPlugin from ansible.utils.display import Display -from ansible.utils.unsafe_proxy import wrap_var as make_unsafe from ansible.template import Templar from ansible_collections.community.dns.plugins.module_utils.provider import ( @@ -35,6 +34,8 @@ from ansible_collections.community.dns.plugins.module_utils.conversion.converter RecordConverter, ) +from ansible_collections.community.dns.plugins.plugin_utils.unsafe import make_unsafe + display = Display() diff --git a/ansible_collections/community/dns/plugins/plugin_utils/unsafe.py b/ansible_collections/community/dns/plugins/plugin_utils/unsafe.py new file mode 100644 index 000000000..1eb61bea0 --- /dev/null +++ b/ansible_collections/community/dns/plugins/plugin_utils/unsafe.py @@ -0,0 +1,41 @@ +# Copyright (c) 2023, Felix Fontein <felix@fontein.de> +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +import re + +from ansible.module_utils.six import binary_type, text_type +from ansible.module_utils.common._collections_compat import Mapping, Set +from ansible.module_utils.common.collections import is_sequence +from ansible.utils.unsafe_proxy import ( + AnsibleUnsafe, + wrap_var as _make_unsafe, +) + +_RE_TEMPLATE_CHARS = re.compile(u'[{}]') +_RE_TEMPLATE_CHARS_BYTES = re.compile(b'[{}]') + + +def make_unsafe(value): + if value is None or isinstance(value, AnsibleUnsafe): + return value + + if isinstance(value, Mapping): + return dict((make_unsafe(key), make_unsafe(val)) for key, val in value.items()) + elif isinstance(value, Set): + return set(make_unsafe(elt) for elt in value) + elif is_sequence(value): + return type(value)(make_unsafe(elt) for elt in value) + elif isinstance(value, binary_type): + if _RE_TEMPLATE_CHARS_BYTES.search(value): + value = _make_unsafe(value) + return value + elif isinstance(value, text_type): + if _RE_TEMPLATE_CHARS.search(value): + value = _make_unsafe(value) + return value + + return value diff --git a/ansible_collections/community/dns/plugins/public_suffix_list.dat b/ansible_collections/community/dns/plugins/public_suffix_list.dat index dd8bd923e..125f1e3d7 100644 --- a/ansible_collections/community/dns/plugins/public_suffix_list.dat +++ b/ansible_collections/community/dns/plugins/public_suffix_list.dat @@ -6710,7 +6710,7 @@ org.zw // newGTLDs -// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2024-03-06T15:14:58Z +// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2024-03-28T15:13:37Z // This list is auto-generated, don't edit it manually. // aaa : American Automobile Association, Inc. // https://www.iana.org/domains/root/db/aaa.html @@ -6988,10 +6988,6 @@ auto // https://www.iana.org/domains/root/db/autos.html autos -// avianca : Avianca Inc. -// https://www.iana.org/domains/root/db/avianca.html -avianca - // aws : AWS Registry LLC // https://www.iana.org/domains/root/db/aws.html aws @@ -12080,6 +12076,7 @@ autocode.dev // AVM : https://avm.de // Submitted by Andreas Weise <a.weise@avm.de> +myfritz.link myfritz.net // AVStack Pte. Ltd. : https://avstack.io @@ -12357,6 +12354,12 @@ pages.dev r2.dev workers.dev +// cloudscale.ch AG : https://www.cloudscale.ch/ +// Submitted by Gaudenz Steinlin <support@cloudscale.ch> +cust.cloudscale.ch +objects.lpg.cloudscale.ch +objects.rma.cloudscale.ch + // Clovyr : https://clovyr.io // Submitted by Patrick Nielsen <patrick@clovyr.io> wnext.app @@ -12374,22 +12377,33 @@ co.cz // CDN77.com : http://www.cdn77.com // Submitted by Jan Krpes <jan.krpes@cdn77.com> -c.cdn77.org +cdn77-storage.com +rsc.contentproxy9.cz cdn77-ssl.net r.cdn77.net -rsc.cdn77.org ssl.origin.cdn77-secure.org +c.cdn77.org +rsc.cdn77.org // Cloud DNS Ltd : http://www.cloudns.net -// Submitted by Aleksander Hristov <noc@cloudns.net> +// Submitted by Aleksander Hristov <noc@cloudns.net> & Boyan Peychev <boyan@cloudns.net> cloudns.asia +cloudns.be cloudns.biz -cloudns.club cloudns.cc +cloudns.ch +cloudns.cl +cloudns.club +dnsabr.com +cloudns.cx cloudns.eu cloudns.in cloudns.info +dns-cloud.net +dns-dynamic.net +cloudns.nz cloudns.org +cloudns.ph cloudns.pro cloudns.pw cloudns.us @@ -12402,6 +12416,11 @@ cnpy.gdn // Submitted by Moritz Marquardt <git@momar.de> codeberg.page +// CodeSandbox B.V. : https://codesandbox.io +// Submitted by Ives van Hoorne <abuse@codesandbox.io> +csb.app +preview.csb.app + // CoDNS B.V. co.nl co.no @@ -12520,6 +12539,7 @@ dyndns.dappnode.io // Dark, Inc. : https://darklang.com // Submitted by Paul Biggar <ops@darklang.com> builtwithdark.com +darklang.io // DataDetect, LLC. : https://datadetect.com // Submitted by Andrew Banchich <abanchich@sceven.com> @@ -12918,6 +12938,10 @@ ondigitalocean.app // Submitted by Robin H. Johnson <psl-maintainers@digitalocean.com> *.digitaloceanspaces.com +// DigitalPlat : https://www.digitalplat.org/ +// Submitted by Edward Hsing <contact@digitalplat.org> +us.kg + // dnstrace.pro : https://dnstrace.pro/ // Submitted by Chris Partridge <chris@partridge.tech> bci.dnstrace.pro @@ -12959,6 +12983,14 @@ easypanel.host // Submitted by <infracloudteam@namecheap.com> *.ewp.live +// Electromagnetic Field : https://www.emfcamp.org +// Submitted by <noc@emfcamp.org> +at.emf.camp + +// Elefunc, Inc. : https://elefunc.com +// Submitted by Cetin Sert <domains@elefunc.com> +rt.ht + // Elementor : Elementor Ltd. // Submitted by Anton Barkan <antonb@elementor.com> elementor.cloud @@ -13250,7 +13282,8 @@ forgeblocks.com id.forgerock.io // Framer : https://www.framer.com -// Submitted by Koen Rouwhorst <koenrh@framer.com> +// Submitted by Koen Rouwhorst <security@framer.com> +framer.ai framer.app framercanvas.com framer.media @@ -13291,6 +13324,24 @@ freemyip.com // Submitted by Daniel A. Maierhofer <vorstand@funkfeuer.at> wien.funkfeuer.at +// Future Versatile Group. :https://www.fvg-on.net/ +// T.Kabu <webmaster@fvg-on.net> +daemon.asia +dix.asia +mydns.bz +0am.jp +0g0.jp +0j0.jp +0t0.jp +mydns.jp +pgw.jp +wjg.jp +keyword-on.net +live-on.net +server-on.net +mydns.tw +mydns.vc + // Futureweb GmbH : https://www.futureweb.at // Submitted by Andreas Schnederle-Wagner <schnederle@futureweb.at> *.futurecms.at @@ -13334,6 +13385,12 @@ gentlentapis.com lab.ms cdn-edges.net +// Getlocalcert: https://www.getlocalcert.net +// Submitted by Robert Alexander <support@getlocalcert.net> +localcert.net +localhostcert.net +corpnet.work + // Ghost Foundation : https://ghost.org // Submitted by Matt Hanley <security@ghost.org> ghost.io @@ -13480,6 +13537,10 @@ whitesnow.jp zombie.jp heteml.net +// GoDaddy Registry : https://registry.godaddy +// Submitted by Rohan Durrant <tldns@registry.godaddy> +graphic.design + // GOV.UK Platform as a Service : https://www.cloud.service.gov.uk/ // Submitted by Tom Whitwell <gov-uk-paas-support@digital.cabinet-office.gov.uk> cloudapps.digital @@ -13599,6 +13660,10 @@ goupile.fr // Submitted by <domeinnaam@minaz.nl> gov.nl +// GrayJay Web Solutions Inc. : https://grayjaysports.ca +// Submitted by Matt Yamkowy <info@grayjaysports.ca> +grayjayleagues.com + // Group 53, LLC : https://www.group53.com // Submitted by Tyler Todd <noc@nova53.net> awsmppl.com @@ -13633,6 +13698,11 @@ hasura-app.io // Submitted by Richard Zowalla <mi-admin@hs-heilbronn.de> pages.it.hs-heilbronn.de +// Helio Networks : https://heliohost.org +// Submitted by Ben Frede <admin@heliohost.org> +helioho.st +heliohost.us + // Hepforge : https://www.hepforge.org // Submitted by David Grellscheid <admin@hepforge.org> hepforge.org @@ -13646,7 +13716,6 @@ herokussl.com // Submitted by Oren Eini <oren@ravendb.net> ravendb.cloud ravendb.community -ravendb.me development.run ravendb.run @@ -13737,7 +13806,7 @@ biz.at info.at // info.cx : http://info.cx -// Submitted by Jacob Slater <whois@igloo.to> +// Submitted by June Slater <whois@igloo.to> info.cx // Interlegis : http://www.interlegis.leg.br @@ -13786,6 +13855,14 @@ iopsys.se // Submitted by Matthew Hardeman <mhardeman@ipifony.com> ipifony.net +// is-a.dev : https://www.is-a.dev +// Submitted by William Harrison <admin@maintainers.is-a.dev> +is-a.dev + +// ir.md : https://nic.ir.md +// Submitted by Ali Soizi <info@nic.ir.md> +ir.md + // IServ GmbH : https://iserv.de // Submitted by Mario Hoberg <info@iserv.de> iservschule.de @@ -13894,6 +13971,11 @@ myjino.ru // Submitted by Daniel Fariña <ingenieria@jotelulu.com> jotelulu.cloud +// JouwWeb B.V. : https://www.jouwweb.nl +// Submitted by Camilo Sperberg <tech@webador.com> +jouwweb.site +webadorsite.com + // Joyent : https://www.joyent.com/ // Submitted by Brian Bennett <brian.bennett@joyent.com> *.triton.zone @@ -13967,6 +14049,10 @@ lpusercontent.com // Submitted by Lelux Admin <publisuffix@lelux.site> lelux.site +// Libre IT Ltd : https://libre.nz +// Submitted by Tomas Maggio <support@libre.nz> +runcontainers.dev + // Lifetime Hosting : https://Lifetime.Hosting/ // Submitted by Mike Fillator <support@lifetime.hosting> co.business @@ -14141,7 +14227,6 @@ co.pl // Managed by Corporate Domains // Microsoft Azure : https://home.azure *.azurecontainer.io -cloudapp.azure.com azure-api.net azureedge.net azurefd.net @@ -14248,13 +14333,18 @@ ngrok.pro torun.pl // Nimbus Hosting Ltd. : https://www.nimbushosting.co.uk/ -// Submitted by Nicholas Ford <nick@nimbushosting.co.uk> +// Submitted by Nicholas Ford <dev@nimbushosting.co.uk> nh-serv.co.uk +nimsite.uk // NFSN, Inc. : https://www.NearlyFreeSpeech.NET/ // Submitted by Jeff Wheelhouse <support@nearlyfreespeech.net> nfshost.com +// NFT.Storage : https://nft.storage/ +// Submitted by Vasco Santos <vasco.santos@protocol.ai> or <support@nft.storage> +ipfs.nftstorage.link + // Noop : https://noop.app // Submitted by Nathaniel Schweinberg <noop@rearc.io> *.developer.app @@ -14434,7 +14524,6 @@ omniwe.site 123minsida.se 123miweb.es 123paginaweb.pt -123sait.ru 123siteweb.fr 123webseite.at 123webseite.de @@ -14452,6 +14541,13 @@ simplesite.pl // Submitted by Eddie Jones <eddie@onefoldmedia.com> nid.io +// Open Domains : https://open-domains.net +// Submitted by William Harrison <admin@open-domains.net> +is-cool.dev +is-not-a.dev +localplayer.dev +is-local.org + // Open Social : https://www.getopensocial.com/ // Submitted by Alexander Varwijk <security@getopensocial.com> opensocial.site @@ -14472,6 +14568,11 @@ operaunite.com // Submitted by Alexandre Linte <alexandre.linte@orange.com> tech.orange +// OsSav Technology Ltd. : https://ossav.com/ +// TLD Nic: http://nic.can.re - TLD Whois Server: whois.can.re +// Submitted by OsSav Technology Ltd. <support@ossav.com> +can.re + // Oursky Limited : https://authgear.com/, https://skygear.io/ // Submitted by Authgear Team <hello@authgear.com>, Skygear Developer <hello@skygear.io> authgear-staging.com @@ -14522,10 +14623,10 @@ pagexl.com // pcarrier.ca Software Inc: https://pcarrier.ca/ // Submitted by Pierre Carrier <pc@rrier.ca> -bar0.net -bar1.net -bar2.net -rdv.to +*.xmit.co +srv.us +gh.srv.us +gl.srv.us // .pl domains (grandfathered) art.pl @@ -14683,9 +14784,12 @@ qcx.io *.sys.qcx.io // QNAP System Inc : https://www.qnap.com -// Submitted by Nick Chang <nickchang@qnap.com> -dev-myqnapcloud.com +// Submitted by Nick Chang <cloudadmin@qnap.com> +myqnapcloud.cn alpha-myqnapcloud.com +dev-myqnapcloud.com +mycloudnas.com +mynascloud.com myqnapcloud.com // Quip : https://quip.com @@ -14915,6 +15019,10 @@ service.gov.scot // Submitted by Shante Adam <shante@skyhat.io> scrysec.com +// Scrypted : https://scrypted.app +// Submitted by Koushik Dutta <public-suffix-list@scrypted.app> +client.scrypted.io + // Securepoint GmbH : https://www.securepoint.de // Submitted by Erik Anders <erik.anders@securepoint.de> firewall-gateway.com @@ -15024,9 +15132,9 @@ small-web.org vp4.me // Snowflake Inc : https://www.snowflake.com/ -// Submitted by Faith Olapade <faith.olapade@snowflake.com> -snowflake.app -privatelink.snowflake.app +// Submitted by Sam Haar <psl@snowflake.com> +*.snowflake.app +*.privatelink.snowflake.app streamlit.app streamlitapp.com @@ -15038,6 +15146,12 @@ try-snowplow.com // Submitted by Drew DeVault <sir@cmpwn.com> srht.site +// StackBlitz : https://stackblitz.com +// Submitted by Dominic Elm <hello@stackblitz.com> +w-corp-staticblitz.com +w-credentialless-staticblitz.com +w-staticblitz.com + // Stackhero : https://www.stackhero.io // Submitted by Adrien Gillon <adrien+public-suffix-list@stackhero.io> stackhero-network.com @@ -15339,6 +15453,10 @@ inc.hk // Submitted by ITComdomains <to@it.com> it.com +// Unison Computing, PBC : https://unison.cloud +// Submitted by Simon Højberg <security@unison.cloud> +unison-services.cloud + // UNIVERSAL DOMAIN REGISTRY : https://www.udr.org.yt/ // see also: whois -h whois.udr.org.yt help // Submitted by Atanunu Igbunuroghene <publicsuffixlist@udr.org.yt> @@ -15388,47 +15506,6 @@ v-info.info // Submitted by Nathan van Bakel <info@voorloper.com> voorloper.cloud -// Voxel.sh DNS : https://voxel.sh/dns/ -// Submitted by Mia Rehlinger <dns@voxel.sh> -neko.am -nyaa.am -be.ax -cat.ax -es.ax -eu.ax -gg.ax -mc.ax -us.ax -xy.ax -nl.ci -xx.gl -app.gp -blog.gt -de.gt -to.gt -be.gy -cc.hn -io.kg -jp.kg -tv.kg -uk.kg -us.kg -de.ls -at.md -de.md -jp.md -to.md -indie.porn -vxl.sh -ch.tc -me.tc -we.tc -nyan.to -at.vg -blog.vu -dev.vu -me.vu - // V.UA Domain Administrator : https://domain.v.ua/ // Submitted by Serhii Rostilo <sergey@rostilo.kiev.ua> v.ua @@ -15457,6 +15534,10 @@ reserve-online.com bookonline.app hotelwithflight.com +// WebWaddle Ltd: https://webwaddle.com/ +// Submitted by Merlin Glander <hostmaster@webwaddle.com> +*.wadl.top + // WeDeploy by Liferay, Inc. : https://www.wedeploy.com // Submitted by Henrique Vicente <security@wedeploy.com> wedeploy.io |