33 lines
850 B
Django/Jinja
33 lines
850 B
Django/Jinja
{
|
|
acme_dns netcup {
|
|
customer_number {{ netcup_customer_id }}
|
|
api_key {{ netcup_api_key }}
|
|
api_password {{ netcup_api_password }}
|
|
}
|
|
email {{ caddy.admin_email | default('admin@example.com') }}
|
|
acme_ca {{ caddy.acme_ca | default('https://acme-v02.api.letsencrypt.org/directory') }}
|
|
}
|
|
|
|
*.{{ domain }} {
|
|
}
|
|
|
|
{% for service in services %}
|
|
{% if service.ports is defined %}
|
|
{% if service.ports is iterable %}
|
|
{% set http_port = service.ports | selectattr('name', 'equalto', 'http') | map(attribute='external') | list %}
|
|
{% if http_port %}
|
|
{{ service.name }}.{{ domain }} {
|
|
{% for vm in service.vm -%}
|
|
reverse_proxy {{ hostvars[vm].ansible_default_ipv4.address }}:{{ http_port[0] }}
|
|
{% endfor %}{{''}}
|
|
log {
|
|
output file /var/log/caddy/{{ service.name }}.log
|
|
format json
|
|
}
|
|
}
|
|
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|