From 04958ece31ada457d0e5116021f19f24c926e2db Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 29 Sep 2021 06:44:31 +0200 Subject: [PATCH] Deprecate ACME v1 (#288) * Deprecate ACME v1. * Fix syntax error. --- changelogs/fragments/288-depecate-acme-v1.yml | 2 ++ plugins/doc_fragments/acme.py | 3 ++- plugins/module_utils/acme/acme.py | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/288-depecate-acme-v1.yml diff --git a/changelogs/fragments/288-depecate-acme-v1.yml b/changelogs/fragments/288-depecate-acme-v1.yml new file mode 100644 index 000000000..9f48bf9ee --- /dev/null +++ b/changelogs/fragments/288-depecate-acme-v1.yml @@ -0,0 +1,2 @@ +deprecated_features: + - "acme_* modules - ACME version 1 is now deprecated and support for it will be removed in community.crypto 2.0.0 (https://github.com/ansible-collections/community.crypto/pull/288)." diff --git a/plugins/doc_fragments/acme.py b/plugins/doc_fragments/acme.py index 049c4e0ed..10363fe44 100644 --- a/plugins/doc_fragments/acme.py +++ b/plugins/doc_fragments/acme.py @@ -76,7 +76,8 @@ class ModuleDocFragment(object): or C(2) for standardized ACME v2 endpoints." - "The default value is C(1). Note that in community.crypto 2.0.0, this option B(will be required) and will no longer have a default." - - "Please also note that we will deprecate ACME v1 support eventually." + - "The value C(1) is deprecated since community.crypto 2.0.0 and will be + removed from community.crypto 3.0.0." type: int choices: [ 1, 2 ] acme_directory: diff --git a/plugins/module_utils/acme/acme.py b/plugins/module_utils/acme/acme.py index cf453447c..fe05e2445 100644 --- a/plugins/module_utils/acme/acme.py +++ b/plugins/module_utils/acme/acme.py @@ -366,6 +366,10 @@ def create_backend(module, needs_acme_v2): if needs_acme_v2 and module.params['acme_version'] < 2: module.fail_json(msg='The {0} module requires the ACME v2 protocol!'.format(module._name)) + if module.params['acme_version'] == 1: + module.deprecate("The value 1 for 'acme_version' is deprecated. Please switch to ACME v2", + version='3.0.0', collection_name='community.crypto') + # AnsibleModule() changes the locale, so change it back to C because we rely # on datetime.datetime.strptime() when parsing certificate dates. locale.setlocale(locale.LC_ALL, 'C')