Skip to content

Commit

Permalink
Renaming letsencrypt -> acme_certificate (ansible#39816)
Browse files Browse the repository at this point in the history
* Renaming letsencrypt -> acme_certificate.

* Also renaming in BOTMETA.yml.
  • Loading branch information
felixfontein authored and Alexander Bethke committed May 15, 2018
1 parent c94ccf7 commit 27ef3ae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/BOTMETA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ files:
$modules/utilities/logic/pause.py: tbielawa
$modules/utilities/logic/set_stats.py: bcoca
$modules/utilities/logic/wait_for.py: AnderEnder gregswift jarv jhoekx
$modules/web_infrastructure/acme_certificate.py: mgruener resmo felixfontein
$modules/web_infrastructure/ansible_tower/: $team_tower
$modules/web_infrastructure/apache2_mod_proxy.py: oboukili
$modules/web_infrastructure/deploy_helper.py: ramondelafuente
Expand All @@ -693,7 +694,6 @@ files:
$modules/web_infrastructure/jenkins_plugin.py: jtyr
$modules/web_infrastructure/jenkins_script.py: hogarthj
$modules/web_infrastructure/jira.py: Slezhuk tarka
$modules/web_infrastructure/letsencrypt.py: mgruener resmo felixfontein
$modules/web_infrastructure/nginx_status_facts.py: resmo
$modules/web_infrastructure/rundeck_acl_policy.py:
$modules/web_infrastructure/rundeck_project.py: nerzhul
Expand Down
1 change: 1 addition & 0 deletions lib/ansible/modules/web_infrastructure/_letsencrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

DOCUMENTATION = '''
---
module: letsencrypt
module: acme_certificate
author: "Michael Gruener (@mgruener)"
version_added: "2.2"
short_description: Create SSL certificates with Let's Encrypt
Expand All @@ -40,6 +40,8 @@
the Let's Encrypt CA, the module can be used with any service using the ACME
v1 or v2 protocol."
- "At least one of C(dest) and C(fullchain_dest) must be specified."
- "Note: this module was called C(letsencrypt) before Ansible 2.6. The usage
did not change."
requirements:
- "python >= 2.6"
- openssl
Expand Down Expand Up @@ -194,23 +196,23 @@
### Example with HTTP challenge ###
- name: Create a challenge for sample.com using a account key from a variable.
letsencrypt:
acme_certificate:
account_key_content: "{{ account_private_key }}"
csr: /etc/pki/cert/csr/sample.com.csr
dest: /etc/httpd/ssl/sample.com.crt
register: sample_com_challenge
# Alternative first step:
- name: Create a challenge for sample.com using a account key from hashi vault.
letsencrypt:
acme_certificate:
account_key_content: "{{ lookup('hashi_vault', 'secret=secret/account_private_key:value') }}"
csr: /etc/pki/cert/csr/sample.com.csr
fullchain_dest: /etc/httpd/ssl/sample.com-fullchain.crt
register: sample_com_challenge
# Alternative first step:
- name: Create a challenge for sample.com using a account key file.
letsencrypt:
acme_certificate:
account_key_src: /etc/pki/cert/private/account.key
csr: /etc/pki/cert/csr/sample.com.csr
dest: /etc/httpd/ssl/sample.com.crt
Expand All @@ -226,7 +228,7 @@
# when: sample_com_challenge is changed
- name: Let the challenge be validated and retrieve the cert and intermediate certificate
letsencrypt:
acme_certificate:
account_key_src: /etc/pki/cert/private/account.key
csr: /etc/pki/cert/csr/sample.com.csr
dest: /etc/httpd/ssl/sample.com.crt
Expand All @@ -237,7 +239,7 @@
### Example with DNS challenge against production ACME server ###
- name: Create a challenge for sample.com using a account key file.
letsencrypt:
acme_certificate:
account_key_src: /etc/pki/cert/private/account.key
account_email: myself@sample.com
src: /etc/pki/cert/csr/sample.com.csr
Expand Down Expand Up @@ -274,7 +276,7 @@
# when: sample_com_challenge is changed
- name: Let the challenge be validated and retrieve the cert and intermediate certificate
letsencrypt:
acme_certificate:
account_key_src: /etc/pki/cert/private/account.key
account_email: myself@sample.com
src: /etc/pki/cert/csr/sample.com.csr
Expand Down Expand Up @@ -1304,6 +1306,8 @@ def main():
),
supports_check_mode=True,
)
if module._name == 'letsencrypt':
module.deprecate("The 'letsencrypt' module is being renamed 'acme_certificate'", version=2.10)

# AnsibleModule() changes the locale, so change it back to C because we rely on time.strptime() when parsing certificate dates.
module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C', LC_CTYPE='C')
Expand Down

0 comments on commit 27ef3ae

Please sign in to comment.