---
# file: roles/haproxy/tasks/buildcerts.yml

- name: "Create PEM file for HaProxy"
  assemble:
    src='/etc/letsencrypt/live/{{ item.domain }}'
    dest='/etc/haproxy/certs/{{ item.domain }}.pem'
    regexp='(fullchain)|(privkey)\.pem'
  with_items: '{{ proxy_certificates_letsencrypt|default([]) }}'
  notify:
    - "Restart HAProxy"