🐛 Fix template in setup-http-dehydrated when IPv6 is missing

This commit is contained in:
Stefan Haun 2022-09-06 21:00:36 +02:00
parent 8617f84f9d
commit 4da338f0ad

View file

@ -1,4 +1,8 @@
<VirtualHost {{ ansible_default_ipv4.address }}:80 [{{ ansible_default_ipv6.address | default('::1') }}]:80> {% if 'address' in ansible_default_ipv6 %}
<VirtualHost {{ ansible_default_ipv4.address }}:80 [{{ ansible_default_ipv6.address }}]:80>
{% else %}
<VirtualHost {{ ansible_default_ipv4.address }}:80>
{% endif %}
ServerAdmin {{ server_admin }} ServerAdmin {{ server_admin }}
ServerName {{ site_name }} ServerName {{ site_name }}
ServerAlias {{ site_name }} ServerAlias {{ site_name }}
@ -9,7 +13,11 @@
</VirtualHost> </VirtualHost>
<IfFile {{dehydrated_certs_dir}}/{{ site_name }}> <IfFile {{dehydrated_certs_dir}}/{{ site_name }}>
<VirtualHost {{ ansible_default_ipv4.address }}:443 [{{ ansible_default_ipv6.address | default('::1') }}]:80> {% if 'address' in ansible_default_ipv6 %}
<VirtualHost {{ ansible_default_ipv4.address }}:443 [{{ ansible_default_ipv6.address }}]:443>
{% else %}
<VirtualHost {{ ansible_default_ipv4.address }}:443>
{% endif %}
ServerAdmin {{ server_admin }} ServerAdmin {{ server_admin }}
ServerName {{ site_name }} ServerName {{ site_name }}
ServerAlias {{ site_name }} ServerAlias {{ site_name }}