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
Branches
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 @@ ...@@ -5,8 +5,8 @@
set_fact: role_drupal_started=true set_fact: role_drupal_started=true
- block: - block:
- name: "LetsEncrypt Certificates" - name: "Install Certs"
include: letsencrypt.yml include: '../../letsencrypt/tasks/cert.yml'
with_subelements: with_subelements:
- '{{ drupal_settings }}' - '{{ drupal_settings }}'
- domains - 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.
Please register or to comment