From dd12b795b5f593dfcdeb872bfc692ff13e70e41d Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 24 Jun 2020 18:46:13 +0100 Subject: [PATCH] Remove pihole Internal VPN server is working just perfectly instead --- .../roles/gateway/files/wireguard-client.conf | 3 -- .../files/pihole/dnsmasq-vpn.conf | 5 -- .../files/pihole/docker-compose.yml | 22 --------- ansible/roles/intersect-docker/tasks/main.yml | 3 -- .../roles/intersect-docker/tasks/pihole.yml | 48 ------------------- .../roles/intersect-docker/vars/pihole.yml | 4 -- terraform/jakehoward.tech.tf | 8 ---- 7 files changed, 93 deletions(-) delete mode 100644 ansible/roles/intersect-docker/files/pihole/dnsmasq-vpn.conf delete mode 100644 ansible/roles/intersect-docker/files/pihole/docker-compose.yml delete mode 100644 ansible/roles/intersect-docker/tasks/pihole.yml delete mode 100644 ansible/roles/intersect-docker/vars/pihole.yml diff --git a/ansible/roles/gateway/files/wireguard-client.conf b/ansible/roles/gateway/files/wireguard-client.conf index 0fb89e3..93e5d6c 100644 --- a/ansible/roles/gateway/files/wireguard-client.conf +++ b/ansible/roles/gateway/files/wireguard-client.conf @@ -1,9 +1,6 @@ [Interface] Address = {{ item.value.ip }} PrivateKey = {{ item.value.private_key }} -{% if item.value != wireguard.clients.intersect %} -DNS = {{ wireguard.clients.intersect.ip }} -{% endif %} [Peer] PublicKey = {{ wireguard.server.public_key }} diff --git a/ansible/roles/intersect-docker/files/pihole/dnsmasq-vpn.conf b/ansible/roles/intersect-docker/files/pihole/dnsmasq-vpn.conf deleted file mode 100644 index 0f6237d..0000000 --- a/ansible/roles/intersect-docker/files/pihole/dnsmasq-vpn.conf +++ /dev/null @@ -1,5 +0,0 @@ -localise-queries - -{% for host in internal_hostnames %} -host-record={{ host }},{{ wireguard.clients.intersect.ip }} -{% endfor %} diff --git a/ansible/roles/intersect-docker/files/pihole/docker-compose.yml b/ansible/roles/intersect-docker/files/pihole/docker-compose.yml deleted file mode 100644 index 9081eeb..0000000 --- a/ansible/roles/intersect-docker/files/pihole/docker-compose.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: "2.3" - -services: - pihole: - container_name: pihole - image: pihole/pihole:v5.0 - ports: - - "{{ wireguard.clients.intersect.ip }}:53:53/tcp" - - "{{ wireguard.clients.intersect.ip }}:53:53/udp" - environment: - - TZ=Europe/London - - VIRTUAL_HOST=pihole.jakehoward.tech - volumes: - - ./pihole/:/etc/pihole/ - - ./dnsmasq.d/:/etc/dnsmasq.d/ - restart: unless-stopped - labels: - - traefik.enable=true - - traefik.http.routers.pihole.rule=Host(`pihole.jakehoward.tech`) - - traefik.http.routers.pihole.tls.certresolver=le - - traefik.http.routers.pihole.middlewares=internal-only@file - - traefik.http.services.pihole-pihole.loadbalancer.server.port=80 diff --git a/ansible/roles/intersect-docker/tasks/main.yml b/ansible/roles/intersect-docker/tasks/main.yml index 6c7c66c..385959f 100644 --- a/ansible/roles/intersect-docker/tasks/main.yml +++ b/ansible/roles/intersect-docker/tasks/main.yml @@ -19,9 +19,6 @@ - name: Install nextcloud include: nextcloud.yml -- name: Install pihole - include: pihole.yml - - name: Install quassel include: quassel.yml diff --git a/ansible/roles/intersect-docker/tasks/pihole.yml b/ansible/roles/intersect-docker/tasks/pihole.yml deleted file mode 100644 index 3598d22..0000000 --- a/ansible/roles/intersect-docker/tasks/pihole.yml +++ /dev/null @@ -1,48 +0,0 @@ -- name: Include pihole variables - include_vars: pihole.yml - -- name: Create pihole directory - file: - path: /opt/pihole - state: directory - owner: "{{ docker_user.name }}" - mode: "{{ docker_compose_directory_mask }}" - become: true - -- name: Install pihole compose file - template: - src: files/pihole/docker-compose.yml - dest: /opt/pihole/docker-compose.yml - mode: "{{ docker_compose_file_mask }}" - owner: "{{ docker_user.name }}" - validate: /usr/bin/docker-compose -f %s config - register: compose_file - become: true - -- name: Create dnsmasq directory - file: - path: /opt/pihole/dnsmasq.d/ - state: directory - mode: "{{ docker_compose_directory_mask }}" - become: true - -- name: Install dnsmasq hosts config - template: - src: files/pihole/dnsmasq-vpn.conf - dest: /opt/pihole/dnsmasq.d/02-vpn.conf - mode: "{{ docker_compose_file_mask }}" - owner: "{{ docker_user.name }}" - register: dnsmasq_vpn_hosts - become: true - -- name: Cycle pihole container - docker_compose: - project_src: /opt/pihole - pull: true - remove_orphans: true - remove_volumes: true - state: "{{ item }}" - when: compose_file.changed or dnsmasq_vpn_hosts.changed - loop: - - absent - - present diff --git a/ansible/roles/intersect-docker/vars/pihole.yml b/ansible/roles/intersect-docker/vars/pihole.yml deleted file mode 100644 index 1a7e3e9..0000000 --- a/ansible/roles/intersect-docker/vars/pihole.yml +++ /dev/null @@ -1,4 +0,0 @@ -internal_hostnames: - - deluge.jakehoward.tech - - speed.jakehoward.tech - - pihole.jakehoward.tech diff --git a/terraform/jakehoward.tech.tf b/terraform/jakehoward.tech.tf index 349d36e..e8a0b04 100644 --- a/terraform/jakehoward.tech.tf +++ b/terraform/jakehoward.tech.tf @@ -84,14 +84,6 @@ resource "cloudflare_record" "jakehowardtech_quassel" { ttl = 1 } -resource "cloudflare_record" "jakehowardtech_pihole" { - zone_id = cloudflare_zone.jakehowardtech.id - name = "pihole" - value = vultr_server.casey.main_ip - type = "A" - ttl = 1 -} - resource "cloudflare_record" "jakehowardtech_collabora" { zone_id = cloudflare_zone.jakehowardtech.id name = "collabora"