Skip to content
Snippets Groups Projects
Commit 021f2b5a authored by jurgenhaas's avatar jurgenhaas
Browse files

Optimize LetsEncrypt and use their role also for HaProxy and Drupal tasks

parent 58f35d23
No related branches found
No related tags found
No related merge requests found
---
# file: roles/drupal/tasks/letsencrypt.yml
- set_fact: filename='/etc/letsencrypt/live/{{ item.1.domain }}/cert.pem'
- name: "Check LetsEncrypt Requirement"
shell: ls {{ filename }}
register: cert_available
failed_when: false
- name: "Install New Cert"
shell: /opt/letsencrypt/letsencrypt-auto certonly -d {{ item.1.domain }} --apache --text --email {{ apache_server_admin }} --agree-tos --redirect --expand --non-interactive
when: cert_available is defined and cert_available.stdout != filename
......@@ -5,8 +5,8 @@
set_fact: role_drupal_started=true
- block:
- name: "LetsEncrypt Certificates"
include: letsencrypt.yml
- name: "Install Certs"
include: '../../letsencrypt/tasks/cert.yml'
with_subelements:
- '{{ drupal_settings }}'
- domains
......
../../letsencrypt/templates/letsencrypt.ini
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment