From 05bca95ab1346d1c87309f88e332f1babfba7928 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 20 Mar 2019 14:21:28 +0100 Subject: [PATCH] ACME: rename acme_account_facts -> acme_account_info (#54082) * Rename acme_account_facts -> acme_account_info. * Add changelog fragment. --- .../54082-acme_account_facts-acme_account_info.yml | 2 ++ lib/ansible/modules/crypto/acme/_acme_account_facts.py | 1 + lib/ansible/modules/crypto/acme/acme_account.py | 2 +- .../{acme_account_facts.py => acme_account_info.py} | 10 +++++++--- .../{acme_account_facts => acme_account_info}/aliases | 0 .../meta/main.yml | 0 .../tasks/impl.yml | 10 +++++----- .../tasks/main.yml | 0 .../tests/validate.yml | 0 9 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 changelogs/fragments/54082-acme_account_facts-acme_account_info.yml create mode 120000 lib/ansible/modules/crypto/acme/_acme_account_facts.py rename lib/ansible/modules/crypto/acme/{acme_account_facts.py => acme_account_info.py} (94%) rename test/integration/targets/{acme_account_facts => acme_account_info}/aliases (100%) rename test/integration/targets/{acme_account_facts => acme_account_info}/meta/main.yml (100%) rename test/integration/targets/{acme_account_facts => acme_account_info}/tasks/impl.yml (96%) rename test/integration/targets/{acme_account_facts => acme_account_info}/tasks/main.yml (100%) rename test/integration/targets/{acme_account_facts => acme_account_info}/tests/validate.yml (100%) diff --git a/changelogs/fragments/54082-acme_account_facts-acme_account_info.yml b/changelogs/fragments/54082-acme_account_facts-acme_account_info.yml new file mode 100644 index 00000000000..9a93892f33a --- /dev/null +++ b/changelogs/fragments/54082-acme_account_facts-acme_account_info.yml @@ -0,0 +1,2 @@ +minor_changes: +- The ``acme_account_facts`` module has been renamed to ``acme_account_info``. diff --git a/lib/ansible/modules/crypto/acme/_acme_account_facts.py b/lib/ansible/modules/crypto/acme/_acme_account_facts.py new file mode 120000 index 00000000000..ffd88bceb58 --- /dev/null +++ b/lib/ansible/modules/crypto/acme/_acme_account_facts.py @@ -0,0 +1 @@ +acme_account_info.py \ No newline at end of file diff --git a/lib/ansible/modules/crypto/acme/acme_account.py b/lib/ansible/modules/crypto/acme/acme_account.py index 5790950347e..c92569b1936 100644 --- a/lib/ansible/modules/crypto/acme/acme_account.py +++ b/lib/ansible/modules/crypto/acme/acme_account.py @@ -33,7 +33,7 @@ seealso: - name: Automatic Certificate Management Environment (ACME) description: The specification of the ACME protocol (RFC 8555). link: https://tools.ietf.org/html/rfc8555 - - module: acme_account_facts + - module: acme_account_info description: Retrieves facts about an ACME account. - module: openssl_privatekey description: Can be used to create a private account key. diff --git a/lib/ansible/modules/crypto/acme/acme_account_facts.py b/lib/ansible/modules/crypto/acme/acme_account_info.py similarity index 94% rename from lib/ansible/modules/crypto/acme/acme_account_facts.py rename to lib/ansible/modules/crypto/acme/acme_account_info.py index 03ab4f787fd..991352207a4 100644 --- a/lib/ansible/modules/crypto/acme/acme_account_facts.py +++ b/lib/ansible/modules/crypto/acme/acme_account_info.py @@ -15,7 +15,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: acme_account_facts +module: acme_account_info author: "Felix Fontein (@felixfontein)" version_added: "2.7" short_description: Retrieves information on ACME accounts @@ -26,6 +26,8 @@ description: - "This module only works with the ACME v2 protocol." notes: - "The M(acme_account) module allows to modify, create and delete ACME accounts." + - "This module was called C(acme_account_facts) before Ansible 2.8. The usage + did not change." seealso: - module: acme_account description: Allows to create, modify or delete an ACME account. @@ -35,7 +37,7 @@ extends_documentation_fragment: EXAMPLES = ''' - name: Check whether an account with the given account key exists - acme_account_facts: + acme_account_info: account_key_src: /etc/pki/cert/private/account.key register: account_data - name: Verify that account exists @@ -48,7 +50,7 @@ EXAMPLES = ''' debug: var=account_data.account.contact - name: Check whether the account exists and is accessible with the given account key - acme_account_facts: + acme_account_info: account_key_content: "{{ acme_account_key }}" account_uri: "{{ acme_account_uri }}" register: account_data @@ -125,6 +127,8 @@ def main(): ), supports_check_mode=True, ) + if module._name == 'acme_account_facts': + module.deprecate("The 'acme_account_facts' module has been renamed to 'acme_account_info'", version='2.12') set_crypto_backend(module) if not module.params.get('validate_certs'): diff --git a/test/integration/targets/acme_account_facts/aliases b/test/integration/targets/acme_account_info/aliases similarity index 100% rename from test/integration/targets/acme_account_facts/aliases rename to test/integration/targets/acme_account_info/aliases diff --git a/test/integration/targets/acme_account_facts/meta/main.yml b/test/integration/targets/acme_account_info/meta/main.yml similarity index 100% rename from test/integration/targets/acme_account_facts/meta/main.yml rename to test/integration/targets/acme_account_info/meta/main.yml diff --git a/test/integration/targets/acme_account_facts/tasks/impl.yml b/test/integration/targets/acme_account_info/tasks/impl.yml similarity index 96% rename from test/integration/targets/acme_account_facts/tasks/impl.yml rename to test/integration/targets/acme_account_info/tasks/impl.yml index bc8678bebcc..3bce6bbaf0c 100644 --- a/test/integration/targets/acme_account_facts/tasks/impl.yml +++ b/test/integration/targets/acme_account_info/tasks/impl.yml @@ -9,7 +9,7 @@ command: openssl ec -in {{ output_dir }}/accountkey.pem -noout -text - name: Check that account does not exist - acme_account_facts: + acme_account_info: select_crypto_backend: "{{ select_crypto_backend }}" account_key_src: "{{ output_dir }}/accountkey.pem" acme_version: 2 @@ -31,7 +31,7 @@ - mailto:example@example.org - name: Check that account exists - acme_account_facts: + acme_account_info: select_crypto_backend: "{{ select_crypto_backend }}" account_key_src: "{{ output_dir }}/accountkey.pem" acme_version: 2 @@ -51,7 +51,7 @@ contact: [] - name: Check that account was modified - acme_account_facts: + acme_account_info: select_crypto_backend: "{{ select_crypto_backend }}" account_key_src: "{{ output_dir }}/accountkey.pem" acme_version: 2 @@ -61,7 +61,7 @@ register: account_modified - name: Check with wrong account URI - acme_account_facts: + acme_account_info: select_crypto_backend: "{{ select_crypto_backend }}" account_key_src: "{{ output_dir }}/accountkey.pem" acme_version: 2 @@ -71,7 +71,7 @@ register: account_not_exist - name: Check with wrong account key - acme_account_facts: + acme_account_info: select_crypto_backend: "{{ select_crypto_backend }}" account_key_src: "{{ output_dir }}/accountkey2.pem" acme_version: 2 diff --git a/test/integration/targets/acme_account_facts/tasks/main.yml b/test/integration/targets/acme_account_info/tasks/main.yml similarity index 100% rename from test/integration/targets/acme_account_facts/tasks/main.yml rename to test/integration/targets/acme_account_info/tasks/main.yml diff --git a/test/integration/targets/acme_account_facts/tests/validate.yml b/test/integration/targets/acme_account_info/tests/validate.yml similarity index 100% rename from test/integration/targets/acme_account_facts/tests/validate.yml rename to test/integration/targets/acme_account_info/tests/validate.yml