Skip to content

Commit

Permalink
Deprecate ACME v1 (#288)
Browse files Browse the repository at this point in the history
* Deprecate ACME v1.

* Fix syntax error.
  • Loading branch information
felixfontein authored Sep 29, 2021
1 parent 838bdd7 commit 04958ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/288-depecate-acme-v1.yml
Original file line number Diff line number Diff line change
@@ -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:/ansible-collections/community.crypto/pull/288)."
3 changes: 2 additions & 1 deletion plugins/doc_fragments/acme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions plugins/module_utils/acme/acme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 04958ec

Please sign in to comment.