diff --git a/tasks/configure.yml b/tasks/configure.yml index e4b3dd6..a06d63e 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -27,6 +27,6 @@ owner: root group: root mode: '0600' - when: deploy_adguard_config is not empty + when: deploy_adguard_config != {} notify: - systemctl-restart-adguard diff --git a/tasks/main.yml b/tasks/main.yml index 9d9710f..59b0e3c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,4 +1,7 @@ --- # task/main file for deploy_adguard - name: "Import prerequisites.yml" - ansible.builtin.include_tasks: prerequisites.yml \ No newline at end of file + ansible.builtin.include_tasks: prerequisites.yml + +- name: "Import configure.yml" + ansible.builtin.include_tasks: configure.yml \ No newline at end of file diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index e69de29..213000a 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -0,0 +1,56 @@ +--- +version: '3.9' + +services: + adguard: + image: adguard/adguardhome:latest + ports: + - "53:53/tcp" + - "53:53/udp" +{% if deploy_adguard_enable_admin_interface %} + - "80:80/tcp" + - "443:443/tcp" + - "3000:3000/tcp" +{% endif %} +{% if deploy_adguard_enable_dhcp %} + - "67:67/udp" + - "68:68/tcp" + - "68:68/udp" +{% endif %} +{% if deploy_adguard_enable_doh %} + - "443:443/udp" +{% endif %} +{% if deploy_adguard_enable_dot %} + - "853:853/tcp" + +{% endif %} +{% if deploy_adguard_enable_doq %} + - "784:784/udp" + - "8853:8853/udp" + - "853:853/udp" +{% endif %} +{% if deploy_adguard_enable_dnscrypt %} + - "5443:5443/tcp" + - "5443:5443/udp" +{% endif %} + volumes: + - conf:/opt/adguardhome/conf + - data:/opt/adguardhome/work + networks: + - internal + +networks: + internal: + driver: bridge + +volumes: + conf: + driver_opts: + o: bind + device: {{ deploy_adguard_directory }}/conf + type: none + data: + driver_opts: + o: bind + device: {{ deploy_adguard_directory }}/data + type: none \ No newline at end of file