Deprecate ACME v1 (#288)

* Deprecate ACME v1.

* Fix syntax error.
This commit is contained in:
Felix Fontein
2021-09-29 06:44:31 +02:00
committed by GitHub
parent 838bdd711b
commit 04958ece31
3 changed files with 8 additions and 1 deletions

View File

@@ -76,7 +76,8 @@ options:
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:

View File

@@ -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')