Skip to content

Instantly share code, notes, and snippets.

@mikeblum
Created December 11, 2021 23:45
Show Gist options
  • Save mikeblum/042c966e3ca0316ef58ee011d859f93b to your computer and use it in GitHub Desktop.
Save mikeblum/042c966e3ca0316ef58ee011d859f93b to your computer and use it in GitHub Desktop.
Pi-hole on Nomad
job "pi-hole" {
datacenters = ["homelab"]
type = "system"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
constraint {
attribute = "${node.class}"
value = "raspberry-pi"
}
group "pi-hole" {
network {
mode = "bridge"
port "dhcp" {
static = 67
to = 67
host_network = "tailscale"
}
port "dns" {
static = 53
to = 53
host_network = "tailscale"
}
port "http" {
static = 8080
to = 80
host_network = "tailscale"
}
}
task "server" {
driver = "docker"
config {
image = "pihole/pihole:latest"
ports = [
"dns",
"dhcp",
"http",
]
volumes = [
"/opt/docker-pi-hole/etc-pihole/:/etc/pihole/",
"/opt/docker-pi-hole/etc-dnsmasq.d/:/etc/dnsmasq.d/",
"/opt/docker-pi-hole/var-log/pihole.log:/var/log/pihole.log",
]
cap_add = ["net_admin", "setfcap"]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment