2016-04-16 18:48:54 +02:00
|
|
|
---
|
2018-08-20 19:18:27 +02:00
|
|
|
- block:
|
|
|
|
- name: Create the acme hooks directory if it does not yet exist
|
|
|
|
file: dest={{ letsencrypt_acme_services_scripts_dir }} state=directory owner=root group=root
|
|
|
|
|
|
|
|
- name: Install a script that fix the letsencrypt certificate for haproxy and then reload the service
|
|
|
|
template: src=haproxy-letsencrypt-acme.sh.j2 dest={{ letsencrypt_acme_services_scripts_dir }}/haproxy owner=root group=root mode=4555
|
|
|
|
|
|
|
|
- name: When we are going to install letsencrypt certificates, create a preliminary path and a self signed cert. Now handle the haproxy special case
|
|
|
|
shell: mkdir {{ pki_dir }}/haproxy ; cat {{ letsencrypt_acme_user_home | default(omit) }}/live/{{ ansible_fqdn }}/privkey {{ letsencrypt_acme_user_home | default(omit) }}/live/{{ ansible_fqdn }}/cert > {{ pki_dir }}/haproxy/haproxy.pem
|
|
|
|
args:
|
|
|
|
creates: '{{ pki_dir }}/haproxy/haproxy.pem'
|
|
|
|
tags: [ 'pki', 'ssl', 'letsencrypt', 'haproxy' ]
|
2016-04-22 18:01:58 +02:00
|
|
|
|
2018-09-16 13:51:34 +02:00
|
|
|
when: letsencrypt_acme_install
|
2016-04-16 18:48:54 +02:00
|
|
|
tags: [ 'haproxy', 'letsencrypt' ]
|