Compare commits

...

6 Commits

Author SHA1 Message Date
KornKalle
eb36535fae
Merge 3d79c9aff80516a82174f9e1cdf281fbef863637 into d35de757e01902399e685c2b344823ebc09b3372 2025-08-19 16:24:55 +08:00
Jeff Geerling
d35de757e0
Merge pull request #239 from C0rn3j/patch-1
Fix broken conditionals in create-cert-standalone.yml
2025-08-19 00:52:32 -04:00
Martin
ef85f3e63d
Fix broken conditionals in create-cert-standalone.yml 2025-07-28 10:01:44 +02:00
nils
3d79c9aff8 add certbot-nginx support, remove ubuntu 16.04 2024-12-09 11:05:09 +01:00
nils
63374e662e add nginx plugin 2024-12-09 10:38:23 +01:00
nils
0385c8b659 add nginx support 2024-06-04 14:56:21 +02:00
8 changed files with 21 additions and 18 deletions

View File

@ -5,11 +5,11 @@ certbot_auto_renew_user: "{{ ansible_user | default(lookup('env', 'USER')) }}"
certbot_auto_renew_hour: "3"
certbot_auto_renew_minute: "30"
certbot_auto_renew_options: "--quiet"
certbot_package: certbot
certbot_testmode: false
certbot_hsts: false
# Parameters used when creating new Certbot certs.
certbot_create_if_missing: false
certbot_create_method: standalone

View File

@ -0,0 +1,9 @@
---
- name: Check if certificate already exists.
stat:
path: /etc/letsencrypt/live/{{ cert_item.domains | first }}/cert.pem
register: letsencrypt_cert
- name: Generate new certificate if one doesn't exist.
command: "{{ certbot_create_command }}"
when: not letsencrypt_cert.stat.exists

View File

@ -28,7 +28,7 @@
mode: 0750
when:
- certbot_create_standalone_stop_services is defined
- certbot_create_standalone_stop_services
- certbot_create_standalone_stop_services is truthy
- name: Create post hook to start services.
template:
@ -39,7 +39,7 @@
mode: 0750
when:
- certbot_create_standalone_stop_services is defined
- certbot_create_standalone_stop_services
- certbot_create_standalone_stop_services is truthy
- name: Check if domains have changed
block:

View File

@ -1,8 +0,0 @@
---
- name: Load a variable file based on the OS type, or a default if not found.
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
- "default.yml"

View File

@ -6,4 +6,4 @@
- name: Set Certbot script variable.
set_fact:
certbot_script: "{{ certbot_package }}"
certbot_script: "certbot"

View File

@ -1,6 +1,4 @@
---
- import_tasks: include-vars.yml
- import_tasks: setup-RedHat.yml
when: ansible_os_family == 'RedHat'
@ -29,5 +27,13 @@
loop_control:
loop_var: cert_item
- include_tasks: create-cert-nginx.yml
with_items: "{{ certbot_certs }}"
when:
- certbot_create_if_missing
- certbot_create_method == 'nginx'
loop_control:
loop_var: cert_item
- import_tasks: renew-cron.yml
when: certbot_auto_renew

View File

@ -1,2 +0,0 @@
---
certbot_package: letsencrypt

View File

@ -1,2 +0,0 @@
---
certbot_package: certbot