From f321286f968101e572358e1c89654e8960164c9d Mon Sep 17 00:00:00 2001 From: Kameron Kenny Date: Mon, 24 Feb 2025 21:10:39 -0500 Subject: [PATCH] add piole3 --- Jenkinsfile | 42 +++++++++++++++++++++++++++++++----- docker-compose.yml | 32 +++++++++++++++++++++++---- etc/dnsmasq.d/01-pihole.conf | 2 -- etc/pihole/pihole-FTL.conf | 2 +- etc/pihole/setupVars.conf | 2 -- 5 files changed, 66 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fd38f58..0c6df9d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,7 +31,8 @@ pipeline { stage('Create contexts') { steps { - sh 'docker context ls | grep pi502 || docker context create pi502 --docker "host=ssh://pi503.in.thelinuxpro.net"' + sh 'docker context ls | grep pi502 || docker context create pi502 --docker "host=ssh://pi502.in.thelinuxpro.net"' + sh 'docker context ls | grep pi503 || docker context create pi503 --docker "host=ssh://pi503.in.thelinuxpro.net"' } } @@ -53,10 +54,10 @@ pipeline { stage('Start pihole1') { steps { script { - def status = sh(returnStatus: true, script: 'grep $(docker --context pi502 compose ps | tail -n1 | awk \'{ print $2 }\') docker-compose.yml') + def status = sh(returnStatus: true, script: 'grep $(docker compose ps | tail -n1 | awk \'{ print $2 }\') docker-compose.yml') if (status != 0) { - sh 'docker compose up -d' + sh 'docker compose up pihole1 -d' sh 'docker compose ps' sh 'sleep 3' sh 'docker compose logs' @@ -70,7 +71,7 @@ pipeline { stage('Stop pihole2') { steps { script { - def status = sh(returnStatus: true, script: 'grep $(docker compose --context pi502 ps | tail -n1 | awk \'{ print $2 }\') docker-compose.yml') + def status = sh(returnStatus: true, script: 'grep $(docker --context pi502 compose ps | tail -n1 | awk \'{ print $2 }\') docker-compose.yml') if (status != 0) { sh 'docker compose --context pi502 down' @@ -88,7 +89,7 @@ pipeline { def status = sh(returnStatus: true, script: 'grep $(docker --context pi502 compose ps | tail -n1 | awk \'{ print $2 }\') docker-compose.yml') if (status != 0) { - sh 'docker --context pi502 compose up -d' + sh 'docker --context pi502 compose up pihole2 -d' sh 'docker --context pi502 compose ps' sh 'sleep 3' sh 'docker --context pi502 compose logs' @@ -99,6 +100,37 @@ pipeline { } } + stage('Stop pihole3') { + steps { + script { + def status = sh(returnStatus: true, script: 'grep $(docker --context pi503 compose ps | tail -n1 | awk \'{ print $2 }\') docker-compose.yml') + + if (status != 0) { + sh 'docker compose --context pi503 down' + sh 'sleep 5' + } else { + echo 'skip' + } + } + } + } + + stage('Start pihole3') { + steps { + script { + def status = sh(returnStatus: true, script: 'grep $(docker --context pi503 compose ps | tail -n1 | awk \'{ print $2 }\') docker-compose.yml') + + if (status != 0) { + sh 'docker --context pi503 compose up pihole3 -d' + sh 'docker --context pi503 compose ps' + sh 'sleep 3' + sh 'docker --context pi503 compose logs' + } else { + echo 'skip' + } + } + } + } // stage('Integration Tests') { // steps { // sh 'mkdir -p test/results/integration' diff --git a/docker-compose.yml b/docker-compose.yml index 5cd5d93..f8abd55 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,13 +10,13 @@ services: build: dockerfile: Dockerfile container_name: pihole1 - image: docker-registry1.in.thelinuxpro.net:5000/tlp/pihole1:250120.0.1 + image: docker-registry1.in.thelinuxpro.net:5000/tlp/pihole1:250224.0.1 restart: unless-stopped environment: TZ: 'America/Indianapolis' WEBPASSWORD: 'forty6and2' FTLCONF_LOCAL_IPV4: '10.200.53.241' - PIHOLE_DNS_: '8.8.8.8;8.8.4.4;10.200.53.254;10.200.254.254' + PIHOLE_DNS_: '8.8.8.8;8.8.4.4' DHCP_ACTIVE: 'false' VIRTUAL_HOST: 'dns1.in.thelinuxpro.net' TEMPERATUREUNIT: 'f' @@ -30,13 +30,13 @@ services: build: dockerfile: Dockerfile container_name: pihole2 - image: docker-registry1.in.thelinuxpro.net:5000/tlp/pihole2:250120.0.1 + image: docker-registry1.in.thelinuxpro.net:5000/tlp/pihole2:250224.0.1 restart: unless-stopped environment: TZ: 'America/Indianapolis' WEBPASSWORD: 'forty6and2' FTLCONF_LOCAL_IPV4: '10.200.53.242' - PIHOLE_DNS_: '8.8.8.8;8.8.4.4;10.200.53.254;10.200.254.254' + PIHOLE_DNS_: '8.8.8.8;8.8.4.4' DHCP_ACTIVE: 'false' VIRTUAL_HOST: 'dns2.in.thelinuxpro.net' TEMPERATUREUNIT: 'f' @@ -45,3 +45,27 @@ services: networks: dns_local_net: ipv4_address: 10.200.53.242 + + pihole3: + build: + dockerfile: Dockerfile + container_name: pihole3 + image: docker-registry1.in.thelinuxpro.net:5000/tlp/pihole3:250224.0.1 + restart: unless-stopped + environment: + TZ: 'America/Indianapolis' + WEBPASSWORD: 'forty6and2' + FTLCONF_LOCAL_IPV4: '10.200.53.243' + PIHOLE_DNS_: '8.8.8.8;8.8.4.4' + DHCP_ACTIVE: 'false' + VIRTUAL_HOST: 'dns3.in.thelinuxpro.net' + TEMPERATUREUNIT: 'f' + QUERY_LOGGING: 'true' + WEBTHEME: 'default-dark' + volumes: + - pihole-etc:/etc/pihole + - pihole-dnsmasq:/etc/dnsmasq.d + networks: + dns_local_net: + ipv4_address: 10.200.53.243 + diff --git a/etc/dnsmasq.d/01-pihole.conf b/etc/dnsmasq.d/01-pihole.conf index e24ea3f..33271c2 100644 --- a/etc/dnsmasq.d/01-pihole.conf +++ b/etc/dnsmasq.d/01-pihole.conf @@ -34,6 +34,4 @@ log-async cache-size=10000 server=8.8.8.8 server=8.8.4.4 -server=10.200.53.254 -server=10.200.254.254 interface=eth0 diff --git a/etc/pihole/pihole-FTL.conf b/etc/pihole/pihole-FTL.conf index fa87d8a..05c26ce 100644 --- a/etc/pihole/pihole-FTL.conf +++ b/etc/pihole/pihole-FTL.conf @@ -1,4 +1,4 @@ #; Pi-hole FTL config file #; Comments should start with #; to avoid issues with PHP and bash reading this file MACVENDORDB=/macvendor.db -LOCAL_IPV4=10.200.53.241 +# LOCAL_IPV4=10.200.53.241 diff --git a/etc/pihole/setupVars.conf b/etc/pihole/setupVars.conf index 322dba8..08136ca 100644 --- a/etc/pihole/setupVars.conf +++ b/etc/pihole/setupVars.conf @@ -4,8 +4,6 @@ WEBTHEME=default-dark TEMPERATUREUNIT=F PIHOLE_DNS_1=8.8.8.8 PIHOLE_DNS_2=8.8.4.4 -PIHOLE_DNS_3=10.200.53.254 -PIHOLE_DNS_4=10.200.254.254 PIHOLE_INTERFACE=eth0 QUERY_LOGGING=true BLOCKING_ENABLED=true