feat: add support for environment variables

This commit is contained in:
Tinyblargon 2023-11-23 20:34:45 +00:00
parent 08543f45b2
commit f8e92b7271
3 changed files with 6 additions and 0 deletions

View File

@ -15,6 +15,8 @@ certbot_create_if_missing: false
certbot_create_method: standalone
certbot_admin_email: email@example.com
certbot_env_vars: {}
# Default webroot, overwritten by individual per-cert webroot directories
certbot_webroot: /var/www/letsencrypt
@ -26,6 +28,8 @@ certbot_certs: []
# - example2.com
# - domains:
# - example3.com
# env_vars:
# REQUESTS_CA_BUNDLE: "/etc/ssl/certs/my_root_ca.pem"
certbot_create_command: >-
{{ certbot_script }} certonly --{{ certbot_create_method }}

View File

@ -39,4 +39,5 @@
- name: Generate new certificate if one doesn't exist.
command: "{{ certbot_create_command }}"
environment: "{{ cert_item.env_vars | default(certbot_env_vars) }}"
when: not letsencrypt_cert.stat.exists

View File

@ -11,4 +11,5 @@
- name: Generate new certificate if one doesn't exist.
command: "{{ certbot_create_command }}"
environment: "{{ cert_item.env_vars | default(certbot_env_vars) }}"
when: not letsencrypt_cert.stat.exists