openstack-ansible-haproxy_s.../templates/letsencrypt_renew_certbot_distro.j2
Danila Balagansky 1664c993b6 Add variable for setting certbot domains option
Add `haproxy_ssl_letsencrypt_domains` variable, which
contains a list (defaults to `external_lb_vip_address`)
for `--domains` certbot option.

Change-Id: I2ebfff9eeb5279a3964b8578a6e66aa132d763f5
2022-09-15 08:03:07 +00:00

10 lines
392 B
Django/Jinja

#!/bin/bash
# renew cert if required and copy to haproxy destination
{% for vip in [ haproxy_bind_external_lb_vip_address ] + extra_lb_tls_vip_addresses %}
cat /etc/letsencrypt/live/{{ haproxy_ssl_letsencrypt_domains | first }}/{fullchain,privkey}.pem \
> {{ haproxy_ssl_cert_path ~ '/haproxy_' ~ ansible_facts['hostname'] ~ '-' ~ vip ~ '.pem' }}
{% endfor %}
systemctl reload haproxy