This commit is contained in:
KornKalle
2025-11-11 08:58:36 +04:00
committed by GitHub
7 changed files with 19 additions and 16 deletions
+9
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
-8
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"
+1 -1
View File
@@ -6,4 +6,4 @@
- name: Set Certbot script variable.
set_fact:
certbot_script: "{{ certbot_package }}"
certbot_script: "certbot"
+8 -2
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