add connect-proxy service file, update compose, reorder defaults

This commit is contained in:
Bertrand Lanson 2023-06-03 13:59:47 +02:00
parent 17d17e5a8c
commit f025fa6cb4
3 changed files with 30 additions and 13 deletions

View File

@ -26,5 +26,12 @@ deploy_adguard_consul:
enable: false
consul_addr: http://127.0.0.1:8500
consul_token: someUUIDhere
service_definition: {}
configuration:
service:
name: adguard
address: "{{ ansible_default_ipv4.address }}"
port: 80
tags: []
connect:
sidecar_service: {}
deploy_adguard_config: {}

View File

@ -0,0 +1,11 @@
[Unit]
Description=Consul Envoy Proxy for Adguard.
After=adguard.service,consul.service
[Service]
ExecStart=/usr/local/bin/consul connect envoy -sidecar-for {{ deploy_adguard_consul['configuration']['service']['name'] }}
Restart=always
RestartSec=3
[Install]
WantedBy=default.target

View File

@ -17,11 +17,11 @@ services:
adguard:
image: adguard/adguardhome:latest
ports:
- "53:53/tcp"
- "53:53/udp"
- "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}53:53/tcp"
- "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}53:53/udp"
{% if deploy_adguard_enable_admin_interface %}
- "80:80/tcp"
- "443:443/tcp"
- "{% if deploy_adguard_consul['enable'] %}127.0.0.1:{% endif %}80:80/tcp"
- "{% if deploy_adguard_consul['enable'] %}127.0.0.1:{% endif %}443:443/tcp"
- "3000:3000/tcp"
{% endif %}
{% if deploy_adguard_enable_dhcp %}
@ -30,20 +30,19 @@ services:
- "68:68/udp"
{% endif %}
{% if deploy_adguard_enable_doh %}
- "443:443/udp"
- "{% if deploy_adguard_virtual_ip['enable'] %}{% endif %}443:443/udp"
{% endif %}
{% if deploy_adguard_enable_dot %}
- "853:853/tcp"
- "{% if deploy_adguard_virtual_ip['enable'] %}{% endif %}853:853/tcp"
{% endif %}
{% if deploy_adguard_enable_doq %}
- "784:784/udp"
- "8853:8853/udp"
- "853:853/udp"
- "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}784:784/udp"
- "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}8853:8853/udp"
- "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}853:853/udp"
{% endif %}
{% if deploy_adguard_enable_dnscrypt %}
- "5443:5443/tcp"
- "5443:5443/udp"
- "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}5443:5443/tcp"
- "{% if deploy_adguard_virtual_ip['enable'] %}{{ deploy_adguard_virtual_ip['vip_addr'] }}:{% endif %}5443:5443/udp"
{% endif %}
volumes:
- conf:/opt/adguardhome/conf